aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/referential_spec.rb
diff options
context:
space:
mode:
authorLuc Donnet2015-01-05 14:56:12 +0100
committerLuc Donnet2015-01-05 14:56:12 +0100
commit3bc6d313bebdc1f03e4021aabbc774a0cd97d938 (patch)
treeac5b8c6d8309012136606d9fd9b9a00290f486a8 /spec/models/referential_spec.rb
parente632a4634b1762f4c73d11f1e5b127de9832a1ff (diff)
downloadchouette-core-3bc6d313bebdc1f03e4021aabbc774a0cd97d938.tar.bz2
Initialize rails 4 migration
Diffstat (limited to 'spec/models/referential_spec.rb')
-rw-r--r--spec/models/referential_spec.rb33
1 files changed, 14 insertions, 19 deletions
diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb
index a11bbd9de..505630586 100644
--- a/spec/models/referential_spec.rb
+++ b/spec/models/referential_spec.rb
@@ -1,70 +1,65 @@
require 'spec_helper'
-describe Referential do
-
- it { should validate_presence_of(:name) }
- it { should validate_presence_of(:slug) }
- it { should validate_presence_of(:prefix) }
- it { should validate_presence_of(:time_zone) }
+describe Referential, :type => :model do
it "create a rule_parameter_set" do
referential = Factory.create(:referential)
- referential.rule_parameter_sets.size.should == 1
+ expect(referential.rule_parameter_sets.size).to eq(1)
end
end
-describe Chouette::StopArea do
+describe Chouette::StopArea, :type => :model do
# check override methods
subject {Factory(:stop_area)}
it "should return referential projection " do
subject.referential.projection_type='27572'
- subject.projection.should == subject.referential.projection_type
+ expect(subject.projection).to eq(subject.referential.projection_type)
end
it "should return projection coordinates when referential has projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type='27572'
- subject.projection_x.should_not be_nil
- subject.projection_y.should_not be_nil
+ expect(subject.projection_x).not_to be_nil
+ expect(subject.projection_y).not_to be_nil
end
it "should return nil projection coordinates when referential has no projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type=nil
- subject.projection_x.should be_nil
- subject.projection_y.should be_nil
+ expect(subject.projection_x).to be_nil
+ expect(subject.projection_y).to be_nil
end
end
-describe Chouette::AccessPoint do
+describe Chouette::AccessPoint, :type => :model do
# check override methods
subject {Factory(:access_point)}
it "should return referential projection " do
subject.referential.projection_type='27572'
- subject.projection.should == subject.referential.projection_type
+ expect(subject.projection).to eq(subject.referential.projection_type)
end
it "should return projection coordinates when referential has projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type='27572'
- subject.projection_x.should_not be_nil
- subject.projection_y.should_not be_nil
+ expect(subject.projection_x).not_to be_nil
+ expect(subject.projection_y).not_to be_nil
end
it "should return nil projection coordinates when referential has no projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type=nil
- subject.projection_x.should be_nil
- subject.projection_y.should be_nil
+ expect(subject.projection_x).to be_nil
+ expect(subject.projection_y).to be_nil
end
end