diff options
| author | Xinhui | 2017-05-11 17:42:20 +0200 |
|---|---|---|
| committer | Xinhui | 2017-05-11 17:42:20 +0200 |
| commit | 7b33e3bb6ab1984bb157156acdd49622cf65267e (patch) | |
| tree | 8efff7cf24569b56c2905aaac510df6c3a2c5638 /spec | |
| parent | c40e4d380ea45d320277da58cf1643d0527aca32 (diff) | |
| parent | 1f6fb9c73206f3984d2f942d5d16fb9c094b2164 (diff) | |
| download | chouette-core-7b33e3bb6ab1984bb157156acdd49622cf65267e.tar.bz2 | |
Merge branch 'master' into staging
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/models/chouette/line_spec.rb | 8 | ||||
| -rw-r--r-- | spec/models/line_spec.rb | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/spec/models/chouette/line_spec.rb b/spec/models/chouette/line_spec.rb index ac9b2c6cd..5a339e7ed 100644 --- a/spec/models/chouette/line_spec.rb +++ b/spec/models/chouette/line_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' describe Chouette::Line, :type => :model do subject { create(:line) } + it { is_expected.to belong_to(:line_referential) } # it { is_expected.to validate_presence_of :network } # it { is_expected.to validate_presence_of :company } @@ -12,6 +13,13 @@ describe Chouette::Line, :type => :model do # it { should validate_presence_of :objectid } it { is_expected.to validate_uniqueness_of :objectid } + describe '#display_name' do + it 'should display local_id, number, name and company name' do + display_name = "#{subject.objectid.local_id} - #{subject.number} - #{subject.name} - #{subject.company.try(:name)}" + expect(subject.display_name).to eq(display_name) + end + end + describe '#objectid' do subject { super().objectid } it { is_expected.to be_kind_of(Chouette::NetexObjectId) } diff --git a/spec/models/line_spec.rb b/spec/models/line_spec.rb deleted file mode 100644 index 259c7035a..000000000 --- a/spec/models/line_spec.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'spec_helper' - -describe Chouette::Line, type: :model do - - subject { create(:line) } - - it { is_expected.to belong_to(:line_referential) } - -end |
