aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorXinhui2016-02-22 15:31:31 +0100
committerXinhui2016-02-22 15:31:31 +0100
commit0a1ffa22d97160797d2c96debbc99b31792a40c5 (patch)
tree7cea5119ddf42cbfe8d1e52c6d28096979830cd4 /spec
parentd49f47b4ac1db2cd88b96d830772bb7773924601 (diff)
downloadchouette-core-0a1ffa22d97160797d2c96debbc99b31792a40c5.tar.bz2
Merge NinoxeExtension concerns
Diffstat (limited to 'spec')
-rw-r--r--spec/models/chouette/stop_area_spec.rb4
-rw-r--r--spec/models/chouette/trident_active_record_spec.rb30
2 files changed, 17 insertions, 17 deletions
diff --git a/spec/models/chouette/stop_area_spec.rb b/spec/models/chouette/stop_area_spec.rb
index b237f08ef..3b19aa17c 100644
--- a/spec/models/chouette/stop_area_spec.rb
+++ b/spec/models/chouette/stop_area_spec.rb
@@ -243,9 +243,9 @@ describe Chouette::StopArea, :type => :model do
describe "#default_position" do
- it "should return nil when StopArea.bounds is nil" do
+ it "should return referential center point when StopArea.bounds is nil" do
allow(Chouette::StopArea).to receive_messages :bounds => nil
- expect(subject.default_position).to be_nil
+ expect(subject.default_position).not_to be_nil
end
it "should return StopArea.bounds center" do
diff --git a/spec/models/chouette/trident_active_record_spec.rb b/spec/models/chouette/trident_active_record_spec.rb
index 9728a2923..654dd6685 100644
--- a/spec/models/chouette/trident_active_record_spec.rb
+++ b/spec/models/chouette/trident_active_record_spec.rb
@@ -31,31 +31,31 @@ describe Chouette::TridentActiveRecord, :type => :model do
describe "#prepare_auto_columns" do
it "should left objectid" do
- tm = Chouette::TimeTable.new :comment => "merge1" , :objectid => "NINOXE:Timetable:merge1"
+ tm = Chouette::TimeTable.new :comment => "merge1" , :objectid => "first:Timetable:merge1"
tm.prepare_auto_columns
- expect(tm.objectid).to eq("NINOXE:Timetable:merge1")
+ expect(tm.objectid).to eq("first:Timetable:merge1")
end
it "should add pending_id to objectid" do
tm = Chouette::TimeTable.new :comment => "merge1"
tm.prepare_auto_columns
- expect(tm.objectid.start_with?("NINOXE:Timetable:__pending_id__")).to be_truthy
+ expect(tm.objectid.start_with?("first:Timetable:__pending_id__")).to be_truthy
end
it "should set id to objectid" do
tm = Chouette::TimeTable.new :comment => "merge1"
tm.save
- expect(tm.objectid).to eq("NINOXE:Timetable:"+tm.id.to_s)
+ expect(tm.objectid).to eq("first:Timetable:"+tm.id.to_s)
end
it "should detect objectid conflicts" do
tm = Chouette::TimeTable.new :comment => "merge1"
tm.save
- tm.objectid = "NINOXE:Timetable:"+(tm.id+1).to_s
+ tm.objectid = "first:Timetable:"+(tm.id+1).to_s
tm.save
tm = Chouette::TimeTable.new :comment => "merge1"
tm.save
- expect(tm.objectid).to eq("NINOXE:Timetable:"+tm.id.to_s+"_1")
+ expect(tm.objectid).to eq("first:Timetable:"+tm.id.to_s+"_1")
end
end
@@ -65,48 +65,48 @@ describe Chouette::TridentActiveRecord, :type => :model do
it "should build automatic objectid when empty" do
g1 = Chouette::GroupOfLine.new( :name => "g1")
g1.save
- expect(g1.objectid).to eq("NINOXE:GroupOfLine:"+g1.id.to_s)
+ expect(g1.objectid).to eq("first:GroupOfLine:"+g1.id.to_s)
end
it "should build automatic objectid with fixed when only suffix given" do
g1 = Chouette::GroupOfLine.new( :name => "g1")
g1.objectid = "toto"
g1.save
- expect(g1.objectid).to eq("NINOXE:GroupOfLine:toto")
+ expect(g1.objectid).to eq("first:GroupOfLine:toto")
end
it "should build automatic objectid with extension when already exists" do
g1 = Chouette::GroupOfLine.new( :name => "g1")
g1.save
cnt = g1.id + 1
- g1.objectid = "NINOXE:GroupOfLine:"+cnt.to_s
+ g1.objectid = "first:GroupOfLine:"+cnt.to_s
g1.save
g2 = Chouette::GroupOfLine.new( :name => "g2")
g2.save
- expect(g2.objectid).to eq("NINOXE:GroupOfLine:"+g2.id.to_s+"_1")
+ expect(g2.objectid).to eq("first:GroupOfLine:"+g2.id.to_s+"_1")
end
it "should build automatic objectid with extension when already exists" do
g1 = Chouette::GroupOfLine.new( :name => "g1")
g1.save
cnt = g1.id + 2
- g1.objectid = "NINOXE:GroupOfLine:"+cnt.to_s
+ g1.objectid = "first:GroupOfLine:"+cnt.to_s
g1.save
g2 = Chouette::GroupOfLine.new( :name => "g2")
- g2.objectid = "NINOXE:GroupOfLine:"+cnt.to_s+"_1"
+ g2.objectid = "first:GroupOfLine:"+cnt.to_s+"_1"
g2.save
g3 = Chouette::GroupOfLine.new( :name => "g3")
g3.save
- expect(g3.objectid).to eq("NINOXE:GroupOfLine:"+g3.id.to_s+"_2")
+ expect(g3.objectid).to eq("first:GroupOfLine:"+g3.id.to_s+"_2")
end
it "should build automatic objectid when id cleared" do
g1 = Chouette::GroupOfLine.new( :name => "g1")
- g1.objectid = "NINOXE:GroupOfLine:xxxx"
+ g1.objectid = "first:GroupOfLine:xxxx"
g1.save
g1.objectid = nil
g1.save
- expect(g1.objectid).to eq("NINOXE:GroupOfLine:"+g1.id.to_s)
+ expect(g1.objectid).to eq("first:GroupOfLine:"+g1.id.to_s)
end
end