aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/referential_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/referential_spec.rb')
-rw-r--r--spec/models/referential_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb
index 9f87d0629..c76b157f8 100644
--- a/spec/models/referential_spec.rb
+++ b/spec/models/referential_spec.rb
@@ -8,10 +8,18 @@ describe Referential, :type => :model do
#expect(referential.rule_parameter_sets.size).to eq(1)
# end
- it { should have_one(:referential_metadata) }
+ it { should have_many(:referential_metadatas) }
it { should belong_to(:workbench) }
- it 'should create a ReferentialCloning when a referential is cloned' do
- expect { create(:referential, created_from: ref) }.to change{ReferentialCloning.count}.by(1)
+ context "Cloning referential" do
+ let(:cloned) { create(:referential, created_from: ref) }
+
+ it 'should create a ReferentialCloning' do
+ expect { cloned }.to change{ReferentialCloning.count}.by(1)
+ end
+
+ it 'should clone referential_metadatas' do
+ expect(cloned.referential_metadatas).not_to be_empty
+ end
end
end