This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from rapid7/issue-237
Support setting Id on policy documents
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
spec/convection/model/template/resource/policy_document_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
|
||
module Convection::Model::Mixin | ||
describe Policy do | ||
let(:template) { double(:template) } | ||
subject { described_class.new(name: 'test-policy', template: template) } | ||
|
||
it 'does not set Id on #document if absent' do | ||
expect(subject.document['Id']).to be_nil | ||
end | ||
|
||
it 'sets Id on #document if provided' do | ||
subject.id('MyDocumentId') | ||
expect(subject.document['Id']).to eq('MyDocumentId') | ||
end | ||
end | ||
end |