diff options
| author | Luc Donnet | 2015-01-15 16:40:30 +0100 |
|---|---|---|
| committer | Luc Donnet | 2015-01-15 16:40:30 +0100 |
| commit | c89c3508eb953e79165ba61aee878db8e4d15ff5 (patch) | |
| tree | f59b362c96c13bd5facba44f356676f3383e6cd3 /spec/models | |
| parent | b9a4d3cde1604f4bea01551d8c85624a313a2dfe (diff) | |
| parent | 7d984efe77efd8e610c91fcefc35c4a3e17412fd (diff) | |
| download | chouette-core-c89c3508eb953e79165ba61aee878db8e4d15ff5.tar.bz2 | |
Fix tests and merge master
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/ninoxe_extension_spec.rb | 57 | ||||
| -rw-r--r-- | spec/models/referential_spec.rb | 56 | ||||
| -rw-r--r-- | spec/models/time_table_combination_spec.rb | 3 |
3 files changed, 57 insertions, 59 deletions
diff --git a/spec/models/ninoxe_extension_spec.rb b/spec/models/ninoxe_extension_spec.rb new file mode 100644 index 000000000..91d259fb6 --- /dev/null +++ b/spec/models/ninoxe_extension_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +describe Chouette::StopArea 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 + 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 + 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 + end + +end + +describe Chouette::AccessPoint 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 + 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 + 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 + end + +end diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb index 505630586..2b6432a2e 100644 --- a/spec/models/referential_spec.rb +++ b/spec/models/referential_spec.rb @@ -7,59 +7,3 @@ describe Referential, :type => :model do expect(referential.rule_parameter_sets.size).to eq(1) end end - -describe Chouette::StopArea, :type => :model do - # check override methods - - subject {Factory(:stop_area)} - - it "should return referential projection " do - subject.referential.projection_type='27572' - 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' - 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 - expect(subject.projection_x).to be_nil - expect(subject.projection_y).to be_nil - end - -end - -describe Chouette::AccessPoint, :type => :model do - # check override methods - - subject {Factory(:access_point)} - - it "should return referential projection " do - subject.referential.projection_type='27572' - 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' - 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 - expect(subject.projection_x).to be_nil - expect(subject.projection_y).to be_nil - end - -end diff --git a/spec/models/time_table_combination_spec.rb b/spec/models/time_table_combination_spec.rb index 20526a0fe..a0f14bcf0 100644 --- a/spec/models/time_table_combination_spec.rb +++ b/spec/models/time_table_combination_spec.rb @@ -5,9 +5,6 @@ describe TimeTableCombination, :type => :model do let!(:combined){Factory(:time_table)} subject {Factory.build(:time_table_combination)} - it { is_expected.to ensure_inclusion_of(:operation).in_array(TimeTableCombination.operations) } - - describe "#combine" do context "when operation is union" do before(:each) do |
