diff options
Diffstat (limited to 'spec')
23 files changed, 46 insertions, 45 deletions
| diff --git a/spec/controllers/routes_controller_spec.rb b/spec/controllers/routes_controller_spec.rb index de6d16c8b..18067dec7 100644 --- a/spec/controllers/routes_controller_spec.rb +++ b/spec/controllers/routes_controller_spec.rb @@ -9,7 +9,7 @@ describe RoutesController, :type => :controller do    shared_examples_for "redirected to referential_line_path(referential,line)" do      it "should redirect_to referential_line_path(referential,line)" do -      #response.should redirect_to( referential_line_path(referential,route.line) ) +      # expect(response).to redirect_to( referential_line_path(referential,route.line) )      end    end    shared_examples_for "line and referential linked" do diff --git a/spec/controllers/vehicle_journey_imports_controller_spec.rb b/spec/controllers/vehicle_journey_imports_controller_spec.rb index ef1ec882a..633f90b70 100644 --- a/spec/controllers/vehicle_journey_imports_controller_spec.rb +++ b/spec/controllers/vehicle_journey_imports_controller_spec.rb @@ -2,6 +2,4 @@ require 'spec_helper'  describe ImportTasksController, :type => :controller do    login_user - -  end diff --git a/spec/features/networks_spec.rb b/spec/features/networks_spec.rb index 523b2e898..75070e7fa 100644 --- a/spec/features/networks_spec.rb +++ b/spec/features/networks_spec.rb @@ -81,7 +81,7 @@ describe "Networks", :type => :feature do    #     click_link "Supprimer ce réseau"    #     page.evaluate_script('window.confirm = function() { return true; }')    #     click_button "Valider" -  #     page.should have_no_content(subject.name) +  #     expect(page).to have_no_content(subject.name)    #   end    # end diff --git a/spec/helpers/exports_helper_spec.rb b/spec/helpers/exports_helper_spec.rb index fec8252d5..3d6b8e70e 100644 --- a/spec/helpers/exports_helper_spec.rb +++ b/spec/helpers/exports_helper_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper'  # describe ExportsHelper do  #   describe "string concat" do  #     it "concats two strings with spaces" do -#       helper.concat_strings("this","that").should == "this that" +#       expect(helper.concat_strings("this","that")).to == "this that"  #     end  #   end  # end diff --git a/spec/helpers/help_helper_spec.rb b/spec/helpers/help_helper_spec.rb index 3df091c10..0b0de512b 100644 --- a/spec/helpers/help_helper_spec.rb +++ b/spec/helpers/help_helper_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper'  # describe HelpHelper do  #   describe "string concat" do  #     it "concats two strings with spaces" do -#       helper.concat_strings("this","that").should == "this that" +#       expect(helper.concat_strings("this","that")).to == "this that"  #     end  #   end  # end diff --git a/spec/helpers/imports_helper_spec.rb b/spec/helpers/imports_helper_spec.rb index ec3bb05c5..12cddeb25 100644 --- a/spec/helpers/imports_helper_spec.rb +++ b/spec/helpers/imports_helper_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper'  # describe ImportsHelper do  #   describe "string concat" do  #     it "concats two strings with spaces" do -#       helper.concat_strings("this","that").should == "this that" +#       expect(helper.concat_strings("this","that")).to == "this that"  #     end  #   end  # end diff --git a/spec/helpers/referentials_helper_spec.rb b/spec/helpers/referentials_helper_spec.rb index 6efc13822..6b659dc8b 100644 --- a/spec/helpers/referentials_helper_spec.rb +++ b/spec/helpers/referentials_helper_spec.rb @@ -6,7 +6,7 @@ require 'spec_helper'  # describe ReferentialsHelper do  #   describe "string concat" do  #     it "concats two strings with spaces" do -#       helper.concat_strings("this","that").should == "this that" +#       expect(helper.concat_strings("this","that")).to == "this that"  #     end  #   end  # end 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     diff --git a/spec/routing/companies_spec.rb b/spec/routing/companies_spec.rb index df16079f3..774431dc3 100644 --- a/spec/routing/companies_spec.rb +++ b/spec/routing/companies_spec.rb @@ -3,19 +3,19 @@ require 'spec_helper'  describe CompaniesController do    describe "routing" do      it "not recognize #routes" do -      get( "/line_referentials/1/companies/2/routes").should_not route_to( +      expect(get( "/line_referentials/1/companies/2/routes")).not_to route_to(          :controller => "companies", :action => "routes",          :line_referential_id => "1", :id => "2"        )      end      it "not recognize #lines" do -      get( "/line_referentials/1/companies/2/lines").should_not route_to( +      expect(get( "/line_referentials/1/companies/2/lines")).not_to route_to(          :controller => "companies", :action => "lines",          :line_referential_id => "1", :id => "2"        )      end      it "recognize and generate #show" do -      get( "/line_referentials/1/companies/2").should route_to( +      expect(get( "/line_referentials/1/companies/2")).to route_to(          :controller => "companies", :action => "show",          :line_referential_id => "1", :id => "2"        ) diff --git a/spec/routing/group_of_lines_spec.rb b/spec/routing/group_of_lines_spec.rb index 8bc437249..2a7262893 100644 --- a/spec/routing/group_of_lines_spec.rb +++ b/spec/routing/group_of_lines_spec.rb @@ -3,19 +3,19 @@ require 'spec_helper'  describe GroupOfLinesController do    describe "routing" do      it "not recognize #routes" do -      get( "/line_referentials/1/group_of_lines/2/routes").should_not route_to( +      expect(get( "/line_referentials/1/group_of_lines/2/routes")).not_to route_to(          :controller => "group_of_lines", :action => "routes",          :line_referential_id => "1", :id => "2"        )      end      it "not recognize #lines" do -      get( "/line_referentials/1/group_of_lines/2/lines").should_not route_to( +      expect(get( "/line_referentials/1/group_of_lines/2/lines")).not_to route_to(          :controller => "group_of_lines", :action => "lines",          :line_referential_id => "1", :id => "2"        )      end      it "recognize and generate #show" do -      get( "/line_referentials/1/group_of_lines/2").should route_to( +      expect(get( "/line_referentials/1/group_of_lines/2")).to route_to(          :controller => "group_of_lines", :action => "show",          :line_referential_id => "1", :id => "2"        ) diff --git a/spec/routing/networks_spec.rb b/spec/routing/networks_spec.rb index 8d5366f88..941f98c1e 100644 --- a/spec/routing/networks_spec.rb +++ b/spec/routing/networks_spec.rb @@ -3,19 +3,19 @@ require 'spec_helper'  describe NetworksController do    describe "routing" do      it "not recognize #routes" do -      get( "/line_referentials/1/networks/2/routes").should_not route_to( +      expect(get( "/line_referentials/1/networks/2/routes")).not_to route_to(          :controller => "networks", :action => "routes",          :line_referential_id => "1", :id => "2"        )      end      it "not recognize #lines" do -      get( "/line_referentials/1/networks/2/lines").should_not route_to( +      expect(get( "/line_referentials/1/networks/2/lines")).not_to route_to(          :controller => "networks", :action => "lines",          :line_referential_id => "1", :id => "2"        )      end      it "recognize and generate #show" do -      get( "/line_referentials/1/networks/2").should route_to( +      expect(get( "/line_referentials/1/networks/2")).to route_to(          :controller => "networks", :action => "show",          :line_referential_id => "1", :id => "2"        ) diff --git a/spec/routing/time_tables_spec.rb b/spec/routing/time_tables_spec.rb index 45e426f4c..720ae0815 100644 --- a/spec/routing/time_tables_spec.rb +++ b/spec/routing/time_tables_spec.rb @@ -3,25 +3,25 @@ require 'spec_helper'  describe TimeTablesController do    describe "routing" do      it "not recognize #routes" do -      get( "/referentials/1/time_tables/2/routes").should_not route_to( +      expect(get( "/referentials/1/time_tables/2/routes")).not_to route_to(          :controller => "time_tables", :action => "routes",          :referential_id => "1", :id => "2"        )      end      it "not recognize #lines" do -      get( "/referentials/1/time_tables/2/lines").should_not route_to( +      expect(get( "/referentials/1/time_tables/2/lines")).not_to route_to(          :controller => "time_tables", :action => "lines",          :referential_id => "1", :id => "2"        )      end      it "not recognize #time_table_periods" do -      get( "/referentials/1/time_tables/2/time_table_periods").should_not route_to( +      expect(get( "/referentials/1/time_tables/2/time_table_periods")).not_to route_to(          "time_table_periods#index",          :referential_id => "1", :time_table_id => "2"        )      end      it "recognize and generate #show" do -      get( "/referentials/1/time_tables/2").should route_to( +      expect(get( "/referentials/1/time_tables/2")).to route_to(          :controller => "time_tables", :action => "show",          :referential_id => "1", :id => "2"        ) diff --git a/spec/support/type_ids_modelable_spec.rb b/spec/support/type_ids_modelable.rb index 9ed341810..9ed341810 100644 --- a/spec/support/type_ids_modelable_spec.rb +++ b/spec/support/type_ids_modelable.rb diff --git a/spec/views/companies/show.html.erb_spec.rb b/spec/views/companies/show.html.erb_spec.rb index f0a8a99d4..dbc544f63 100644 --- a/spec/views/companies/show.html.erb_spec.rb +++ b/spec/views/companies/show.html.erb_spec.rb @@ -12,7 +12,7 @@ describe "/companies/show", :type => :view do    # it "should display a map with class 'company'" do    #   render -  #   rendered.should have_selector("#map", :class => 'company') +  #  expect(rendered).to have_selector("#map", :class => 'company')    # end    it "should render a link to edit the company" do diff --git a/spec/views/connection_links/show.html.erb_spec.rb b/spec/views/connection_links/show.html.erb_spec.rb index 1a7ad3d16..c04a4f3f1 100644 --- a/spec/views/connection_links/show.html.erb_spec.rb +++ b/spec/views/connection_links/show.html.erb_spec.rb @@ -18,7 +18,7 @@ describe "/connection_links/show", :type => :view do  #  it "should display a map with class 'connection_link'" do  #    pending ": map not yet implemented"  #     render -#     rendered.should have_selector("#map", :class => 'connection_link') +#     expect(rendered).to have_selector("#map", :class => 'connection_link')  #  end    it "should render a link to edit the connection_link" do diff --git a/spec/views/layouts/application.html.erb_spec.rb b/spec/views/layouts/application.html.erb_spec.rb index 700084922..80e3e6f86 100644 --- a/spec/views/layouts/application.html.erb_spec.rb +++ b/spec/views/layouts/application.html.erb_spec.rb @@ -12,7 +12,7 @@ describe "/layouts/application", :type => :view do      it "should display referential name as title" #do      #   render -    #   rendered.should_not have_selector("h1") +    #   expect(rendered).not_to have_selector("h1")      # end    end diff --git a/spec/views/lines/show.html.erb_spec.rb b/spec/views/lines/show.html.erb_spec.rb index 939d6bc83..3a9efa0ce 100644 --- a/spec/views/lines/show.html.erb_spec.rb +++ b/spec/views/lines/show.html.erb_spec.rb @@ -19,7 +19,7 @@ describe "/lines/show", :type => :view do    # it "should display a map with class 'line'" do    #   render -  #   rendered.should have_selector("#map", :class => 'line') +  #   expect(rendered).to have_selector("#map", :class => 'line')    # end    # FIXME #2018    xit "should render a link to edit the line" do diff --git a/spec/views/organisations/show.html.erb b/spec/views/organisations/show.html.erb index 69f5e2956..84af3b044 100644 --- a/spec/views/organisations/show.html.erb +++ b/spec/views/organisations/show.html.erb @@ -10,7 +10,7 @@ describe "/organisations/show" do    it "should render each User" do      render      organisation.users.each do |user| -      rendered.should have_selector("div.user span.name", :text => user.name) +      expect(rendered).to have_selector("div.user span.name", :text => user.name)      end    end diff --git a/spec/views/routes/show.html.erb_spec.rb b/spec/views/routes/show.html.erb_spec.rb index 787bf72d0..7557ede27 100644 --- a/spec/views/routes/show.html.erb_spec.rb +++ b/spec/views/routes/show.html.erb_spec.rb @@ -26,7 +26,7 @@ describe "/routes/show", :type => :view do    # it "should display a map with class 'line'" do    #   render -  #   rendered.should have_selector("#map", :class => 'line') +  #   expect(rendered).to have_selector("#map", :class => 'line')    # end    # it "should render a link to edit the route" do diff --git a/spec/views/stop_areas/show.html.erb_spec.rb b/spec/views/stop_areas/show.html.erb_spec.rb index 0c9c6663b..a22379402 100644 --- a/spec/views/stop_areas/show.html.erb_spec.rb +++ b/spec/views/stop_areas/show.html.erb_spec.rb @@ -14,7 +14,7 @@ describe "/stop_areas/show", :type => :view do    # it "should display a map with class 'stop_area'" do    #   render -  #   rendered.should have_selector("#map", :class => 'stop_area') +  #   expect(rendered).to have_selector("#map", :class => 'stop_area')    # end    it "should render a link to edit the stop_area" do | 
