Skip to content

Commit

Permalink
Test cleanup
Browse files Browse the repository at this point in the history
- Remove extra context
- Remove references to ServiceTemplate and use test_class instead
  • Loading branch information
bdunne committed Feb 28, 2019
1 parent 1616dfa commit afb9715
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 afb9715

Please sign in to comment.