aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/referential_spec.rb
diff options
context:
space:
mode:
authorXinhui2016-10-26 11:43:02 +0200
committerXinhui2016-10-26 11:43:02 +0200
commit4e9215c718e81921cbcfe1a78cf8542b5ecb4aa3 (patch)
tree54edbc5d2117640f46a3192e0a3151f73495c202 /spec/models/referential_spec.rb
parentdb300abfa571285500830525f893da851a96c093 (diff)
downloadchouette-core-4e9215c718e81921cbcfe1a78cf8542b5ecb4aa3.tar.bz2
Referential clonning refactoring + clone metadatas
Refs #1863
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