Skip to content

Commit

Permalink
Merge pull request ManageIQ#2 from bdunne/fix_up_spec
Browse files Browse the repository at this point in the history
Test cleanup
  • Loading branch information
d-m-u authored Feb 28, 2019
2 parents 1616dfa + afb9715 commit 4b435d7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions spec/lib/uuid_mixin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ def self.name; "TestClass"; end
end
end

let(:service_template) { FactoryBot.create(:service_template) }
let(:dialog_field) { FactoryBot.create(:dialog_field) }
it '#dup resets guid' do
original = test_class.create!
expect(original.guid).to be_guid

context 'with dup overriden' do
it 'resets guid' do
expect(service_template.dup.guid).not_to eq(service_template.guid)
end
duplicate = original.dup.tap(&:save!)
expect(duplicate).to be_valid
expect(duplicate.guid).to be_guid
expect(duplicate.guid).not_to eq(original.guid)
end
end

0 comments on commit 4b435d7

Please sign in to comment.