aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorXinhui2017-07-25 17:26:16 +0200
committerXinhui2017-07-25 17:26:16 +0200
commitcf874823dada5882439c16b5290a6e72ef7712cf (patch)
tree42711cecefb0db576d43a6eec65b5c909df1bc50 /spec/models
parent29ee74e00700f95cadbf1d462dddaad1167ffd82 (diff)
downloadchouette-core-cf874823dada5882439c16b5290a6e72ef7712cf.tar.bz2
Edit factories objectid in accordance with new stif netex format
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/chouette/access_link_spec.rb12
-rw-r--r--spec/models/chouette/access_point_spec.rb2
-rw-r--r--spec/models/chouette/connection_link_spec.rb2
-rw-r--r--spec/models/chouette/route/route_base_spec.rb2
-rw-r--r--spec/models/chouette/stop_point_spec.rb2
-rw-r--r--spec/models/chouette/time_table_spec.rb22
6 files changed, 21 insertions, 21 deletions
diff --git a/spec/models/chouette/access_link_spec.rb b/spec/models/chouette/access_link_spec.rb
index 0e1e91593..5a31b8f0c 100644
--- a/spec/models/chouette/access_link_spec.rb
+++ b/spec/models/chouette/access_link_spec.rb
@@ -7,7 +7,7 @@ describe Chouette::AccessLink, :type => :model do
describe '#objectid' do
subject { super().objectid }
- it { is_expected.to be_kind_of(Chouette::ObjectId) }
+ it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }
end
it { is_expected.to validate_presence_of :name }
@@ -19,7 +19,7 @@ describe Chouette::AccessLink, :type => :model do
def self.legacy_link_types
%w{Underground Mixed Overground}
end
-
+
legacy_link_types.each do |link_type|
context "when link_type is #{link_type}" do
access_link_type = Chouette::ConnectionLinkType.new(link_type.underscore)
@@ -32,7 +32,7 @@ describe Chouette::AccessLink, :type => :model do
end
describe "#access_link_type=" do
-
+
it "should change link_type with ConnectionLinkType#name" do
subject.access_link_type = "underground"
expect(subject.link_type).to eq("Underground")
@@ -45,7 +45,7 @@ describe Chouette::AccessLink, :type => :model do
def self.legacy_link_orientations
%w{AccessPointToStopArea StopAreaToAccessPoint}
end
-
+
legacy_link_orientations.each do |link_orientation|
context "when link_orientation is #{link_orientation}" do
link_orientation_type = Chouette::LinkOrientationType.new(link_orientation.underscore)
@@ -59,7 +59,7 @@ describe Chouette::AccessLink, :type => :model do
end
describe "#link_orientation_type=" do
-
+
it "should change link_orientation with LinkOrientationType#name" do
subject.link_orientation_type = "access_point_to_stop_area"
expect(subject.link_orientation).to eq("AccessPointToStopArea")
@@ -76,7 +76,7 @@ describe Chouette::AccessLink, :type => :model do
subject.link_orientation_type = "stop_area_to_access_point"
expect(subject.link_key).to eq("S_#{subject.stop_area.id}-A_#{subject.access_point.id}")
end
-
+
end
end
diff --git a/spec/models/chouette/access_point_spec.rb b/spec/models/chouette/access_point_spec.rb
index 02b1621e3..cc26d2aa8 100644
--- a/spec/models/chouette/access_point_spec.rb
+++ b/spec/models/chouette/access_point_spec.rb
@@ -4,7 +4,7 @@ describe Chouette::AccessPoint, :type => :model do
describe '#objectid' do
subject { super().objectid }
- it { is_expected.to be_kind_of(Chouette::ObjectId) }
+ it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }
end
it { is_expected.to validate_presence_of :name }
diff --git a/spec/models/chouette/connection_link_spec.rb b/spec/models/chouette/connection_link_spec.rb
index 5921bf581..57eb7d66c 100644
--- a/spec/models/chouette/connection_link_spec.rb
+++ b/spec/models/chouette/connection_link_spec.rb
@@ -11,7 +11,7 @@ describe Chouette::ConnectionLink, :type => :model do
describe '#objectid' do
subject { super().objectid }
- it { is_expected.to be_kind_of(Chouette::ObjectId) }
+ it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }
end
it { is_expected.to validate_presence_of :name }
diff --git a/spec/models/chouette/route/route_base_spec.rb b/spec/models/chouette/route/route_base_spec.rb
index 08f201022..4bf25c2bc 100644
--- a/spec/models/chouette/route/route_base_spec.rb
+++ b/spec/models/chouette/route/route_base_spec.rb
@@ -4,7 +4,7 @@ RSpec.describe Chouette::Route, :type => :model do
describe '#objectid' do
subject { super().objectid }
- it { is_expected.to be_kind_of(Chouette::ObjectId) }
+ it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }
end
it { is_expected.to enumerize(:direction).in(:straight_forward, :backward, :clockwise, :counter_clockwise, :north, :north_west, :west, :south_west, :south, :south_east, :east, :north_east) }
diff --git a/spec/models/chouette/stop_point_spec.rb b/spec/models/chouette/stop_point_spec.rb
index 212c32e1a..5eae8caf0 100644
--- a/spec/models/chouette/stop_point_spec.rb
+++ b/spec/models/chouette/stop_point_spec.rb
@@ -9,7 +9,7 @@ describe Chouette::StopPoint, :type => :model do
describe '#objectid' do
subject { super().objectid }
- it { is_expected.to be_kind_of(Chouette::ObjectId) }
+ it { is_expected.to be_kind_of(Chouette::StifNetexObjectid) }
end
describe "#destroy" do
diff --git a/spec/models/chouette/time_table_spec.rb b/spec/models/chouette/time_table_spec.rb
index fb59a75be..d7738bbf6 100644
--- a/spec/models/chouette/time_table_spec.rb
+++ b/spec/models/chouette/time_table_spec.rb
@@ -813,13 +813,13 @@ end
describe "#intersects" do
it "should return day if a date equal day" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1")
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc")
time_table.dates << Chouette::TimeTableDate.new( :date => Date.today, :in_out => true)
expect(time_table.intersects([Date.today])).to eq([Date.today])
end
it "should return [] if a period not include days" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 12)
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 12)
time_table.periods << Chouette::TimeTablePeriod.new(
:period_start => Date.new(2013, 05, 27),
:period_end => Date.new(2013, 05, 30))
@@ -827,7 +827,7 @@ end
end
it "should return days if a period include day" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 12) # Day type monday and tuesday
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 12) # Day type monday and tuesday
time_table.periods << Chouette::TimeTablePeriod.new(
:period_start => Date.new(2013, 05, 27),
:period_end => Date.new(2013, 05, 30))
@@ -839,13 +839,13 @@ end
describe "#include_day?" do
it "should return true if a date equal day" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1")
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc")
time_table.dates << Chouette::TimeTableDate.new( :date => Date.today, :in_out => true)
expect(time_table.include_day?(Date.today)).to eq(true)
end
it "should return true if a period include day" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 12) # Day type monday and tuesday
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 12) # Day type monday and tuesday
time_table.periods << Chouette::TimeTablePeriod.new(
:period_start => Date.new(2013, 05, 27),
:period_end => Date.new(2013, 05, 29))
@@ -855,13 +855,13 @@ end
describe "#include_in_dates?" do
it "should return true if a date equal day" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1")
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc")
time_table.dates << Chouette::TimeTableDate.new( :date => Date.today, :in_out => true)
expect(time_table.include_in_dates?(Date.today)).to eq(true)
end
it "should return false if a period include day but that is exclued" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 12) # Day type monday and tuesday
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 12) # Day type monday and tuesday
excluded_date = Date.new(2013, 05, 27)
time_table.dates << Chouette::TimeTableDate.new( :date => excluded_date, :in_out => false)
expect(time_table.include_in_dates?( excluded_date)).to be_falsey
@@ -870,7 +870,7 @@ end
describe "#include_in_periods?" do
it "should return true if a period include day" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 4)
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 4)
time_table.periods << Chouette::TimeTablePeriod.new(
:period_start => Date.new(2012, 1, 1),
:period_end => Date.new(2012, 01, 30))
@@ -878,7 +878,7 @@ end
end
it "should return false if a period include day but that is exclued" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 12) # Day type monday and tuesday
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 12) # Day type monday and tuesday
excluded_date = Date.new(2013, 05, 27)
time_table.dates << Chouette::TimeTableDate.new( :date => excluded_date, :in_out => false)
time_table.periods << Chouette::TimeTablePeriod.new(
@@ -890,7 +890,7 @@ end
describe "#include_in_overlap_dates?" do
it "should return true if a day is included in overlap dates" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 4)
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 4)
time_table.periods << Chouette::TimeTablePeriod.new(
:period_start => Date.new(2012, 1, 1),
:period_end => Date.new(2012, 01, 30))
@@ -898,7 +898,7 @@ end
expect(time_table.include_in_overlap_dates?(Date.new(2012, 1, 2))).to eq(true)
end
it "should return false if the day is excluded" do
- time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1", :int_day_types => 4)
+ time_table = Chouette::TimeTable.create!(:comment => "Test", :objectid => "test:Timetable:1:loc", :int_day_types => 4)
time_table.periods << Chouette::TimeTablePeriod.new(
:period_start => Date.new(2012, 1, 1),
:period_end => Date.new(2012, 01, 30))