diff options
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/compliance_check_task_spec.rb | 9 | ||||
| -rw-r--r-- | spec/models/ninoxe_extension_spec.rb | 22 | ||||
| -rw-r--r-- | spec/models/organisation_spec.rb | 2 | ||||
| -rw-r--r-- | spec/models/vehicle_journey_import_spec.rb | 4 | 
4 files changed, 20 insertions, 17 deletions
| diff --git a/spec/models/compliance_check_task_spec.rb b/spec/models/compliance_check_task_spec.rb index 2e5379de7..a062fdb58 100644 --- a/spec/models/compliance_check_task_spec.rb +++ b/spec/models/compliance_check_task_spec.rb @@ -1,5 +1,8 @@  # require 'spec_helper' +# TODO: Can we get rid of this??? +#       ************************* +  # describe ComplianceCheckTask, :type => :model do  #   subject { Factory( :compliance_check_task ) } @@ -274,19 +277,19 @@  # #  # #    it "should create a ComplianceCheckResult :started when started" do  # #      subject.validate -# #      subject.compliance_check_results.first.should be_log_message(:key => "started") +     # expect(subject.compliance_check_results.first).to be_log_message(:key => "started")  # #    end  # #  # #    it "should create a ComplianceCheckResult :completed when completed" do  # #      subject.validate -# #      subject.compliance_check_results.last.should be_log_message(:key => "completed") +     # expect(subject.compliance_check_results.last).to be_log_message(:key => "completed")  # #    end  # #  # #    it "should create a ComplianceCheckResult :failed when failed" do  # #      pending  # #      # subject.loader.stub(:export).and_raise("export failed")  # #      subject.validate -# #      subject.compliance_check_results.last.should be_log_message(:key => "failed") +     # expect(subject.compliance_check_results.last).to be_log_message(:key => "failed")  # #    end  # #  # #  end diff --git a/spec/models/ninoxe_extension_spec.rb b/spec/models/ninoxe_extension_spec.rb index b8892f053..016e10496 100644 --- a/spec/models/ninoxe_extension_spec.rb +++ b/spec/models/ninoxe_extension_spec.rb @@ -8,23 +8,23 @@ describe Chouette::StopArea do      # FIXME #821      # 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 @@ -34,25 +34,25 @@ describe Chouette::AccessPoint do     subject {create(:access_point)} -    it "should return referential projection " do +    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 diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb index 9b4235755..527f71015 100644 --- a/spec/models/organisation_spec.rb +++ b/spec/models/organisation_spec.rb @@ -10,7 +10,7 @@ describe Organisation, :type => :model do    it "create a rule_parameter_set" do      organisation = create(:organisation) -    organisation.rule_parameter_sets.size.should == 1 +    expect(organisation.rule_parameter_sets.size).to eq(1)    end    describe "Portail sync" do diff --git a/spec/models/vehicle_journey_import_spec.rb b/spec/models/vehicle_journey_import_spec.rb index c4d452f84..a743bdecb 100644 --- a/spec/models/vehicle_journey_import_spec.rb +++ b/spec/models/vehicle_journey_import_spec.rb @@ -119,7 +119,7 @@ describe VehicleJourneyImport, :type => :model do      it "should return false when stop points in file are not the same in the route" do        vehicle_journey_import = VehicleJourneyImport.new(:route => other_route, :file => valid_file) -      expect { vehicle_journey_import.load_imported_vehicle_journeys }.to raise_exception +      expect { vehicle_journey_import.load_imported_vehicle_journeys }.to raise_error(RuntimeError)      end      # it "should return errors when vehicle journeys in file are invalid" do             @@ -130,7 +130,7 @@ describe VehicleJourneyImport, :type => :model do      it "should return errors when vehicle journey at stops in file are invalid" do                   vehicle_journey_import = VehicleJourneyImport.new(:route => route, :file => invalid_file_on_vjas) -      expect { vehicle_journey_import.load_imported_vehicle_journeys }.to raise_exception +      expect { vehicle_journey_import.load_imported_vehicle_journeys }.to raise_error(ArgumentError)      end      it "should return errors when vehicle journey at stops are not in ascendant order" do     | 
