diff options
| author | Teddy Wing | 2017-09-22 18:58:54 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-09-22 18:58:54 +0200 |
| commit | beced2b5817da0082aa9f3af76581a524535d801 (patch) | |
| tree | d8ccbd6db3e3cf6a3173b4e34e111e8a9f7af9ac /spec/models | |
| parent | 16f01969fedd429b2c7916eafb19a8a9263bce81 (diff) | |
| download | chouette-core-beced2b5817da0082aa9f3af76581a524535d801.tar.bz2 | |
Add `has_many` association between `Referential` and `ReferentialSuite`
`ReferentialSuite` has many `Referential`s. Need to add a foreign key
column to the `referentials` table to allow that to work.
Refs #3519
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/referential_spec.rb | 1 | ||||
| -rw-r--r-- | spec/models/referential_suite_spec.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb index f9ace08cc..bb8fabb2e 100644 --- a/spec/models/referential_spec.rb +++ b/spec/models/referential_spec.rb @@ -10,6 +10,7 @@ describe Referential, :type => :model do it { should have_many(:metadatas) } it { should belong_to(:workbench) } + it { should belong_to(:referential_suite) } context ".referential_ids_in_periode" do it 'should retrieve referential id in periode range' do diff --git a/spec/models/referential_suite_spec.rb b/spec/models/referential_suite_spec.rb index 73a616ae1..771187b55 100644 --- a/spec/models/referential_suite_spec.rb +++ b/spec/models/referential_suite_spec.rb @@ -1,4 +1,5 @@ RSpec.describe ReferentialSuite, type: :model do it { should belong_to(:new).class_name('Referential') } it { should belong_to(:current).class_name('Referential') } + it { should have_many(:referentials) } end |
