diff options
Diffstat (limited to 'spec/controllers')
9 files changed, 32 insertions, 32 deletions
diff --git a/spec/controllers/api/v1/lines_controller_spec.rb b/spec/controllers/api/v1/lines_controller_spec.rb index 1d9383593..d57eed766 100644 --- a/spec/controllers/api/v1/lines_controller_spec.rb +++ b/spec/controllers/api/v1/lines_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Api::V1::LinesController do +describe Api::V1::LinesController, :type => :controller do let!(:line) { referential.lines.first || create(:line) } it_behaves_like "api key protected controller" do @@ -14,7 +14,7 @@ describe Api::V1::LinesController do end it "should assign expected lines" do - assigns[:lines].should == [line] + expect(assigns[:lines]).to eq([line]) end end end diff --git a/spec/controllers/api/v1/networks_controller_spec.rb b/spec/controllers/api/v1/networks_controller_spec.rb index 01e3ee35d..1872625ca 100644 --- a/spec/controllers/api/v1/networks_controller_spec.rb +++ b/spec/controllers/api/v1/networks_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Api::V1::NetworksController do +describe Api::V1::NetworksController, :type => :controller do let!(:network) { referential.networks.first || create(:network) } it_behaves_like "api key protected controller" do @@ -15,7 +15,7 @@ describe Api::V1::NetworksController do end it "should assign expected network" do - assigns[:network].should == network + expect(assigns[:network]).to eq(network) end end end @@ -27,7 +27,7 @@ describe Api::V1::NetworksController do end it "should assign expected networks" do - assigns[:networks].should == [network] + expect(assigns[:networks]).to eq([network]) end end end diff --git a/spec/controllers/api/v1/stop_area_controller_spec.rb b/spec/controllers/api/v1/stop_area_controller_spec.rb index 8f1b47078..eb0c87661 100644 --- a/spec/controllers/api/v1/stop_area_controller_spec.rb +++ b/spec/controllers/api/v1/stop_area_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Api::V1::StopAreasController do +describe Api::V1::StopAreasController, :type => :controller do let!(:stop_area) { referential.stop_areas.first || create(:stop_area) } it_behaves_like "api key protected controller" do @@ -14,7 +14,7 @@ describe Api::V1::StopAreasController do get :index, :route_id => route.objectid, :line_id => route.line.objectid end it "should assign expected stop_areas" do - assigns[:stop_areas].map(&:id).sort.should == route.stop_areas.map(&:id).sort + expect(assigns[:stop_areas].map(&:id).sort).to eq(route.stop_areas.map(&:id).sort) end end describe "GET #index, :q => { :name_cont => 'aa'}" do @@ -26,7 +26,7 @@ describe Api::V1::StopAreasController do get :index, :q => { :name_cont => "aa"} end it "should assign expected stop_areas" do - assigns[:stop_areas].map(&:name).sort.should == [ sa1.name, sa2.name] + expect(assigns[:stop_areas].map(&:name).sort).to eq([ sa1.name, sa2.name]) end end end diff --git a/spec/controllers/exports_controller_spec.rb b/spec/controllers/exports_controller_spec.rb index fd7b182d7..6cd6e4c54 100644 --- a/spec/controllers/exports_controller_spec.rb +++ b/spec/controllers/exports_controller_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' -describe ExportsController do +describe ExportsController, :type => :controller do login_user describe "GET 'new'" do it "returns http success" do pending get 'new' - response.should be_success + expect(response).to be_success end end @@ -15,7 +15,7 @@ describe ExportsController do it "returns http success" do pending get 'index' - response.should be_success + expect(response).to be_success end end diff --git a/spec/controllers/import_tasks_controller_spec.rb b/spec/controllers/import_tasks_controller_spec.rb index d9b8b7660..68b3e0eb2 100644 --- a/spec/controllers/import_tasks_controller_spec.rb +++ b/spec/controllers/import_tasks_controller_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' -describe ImportTasksController do +describe ImportTasksController, :type => :controller do login_user shared_examples_for "referential dependant" do it "assigns referential as @referential" do - assigns[:referential].should == referential + expect(assigns[:referential]).to eq(referential) end end @@ -15,19 +15,19 @@ describe ImportTasksController do end it_behaves_like "referential dependant" it "should assign import_task with NeptuneImport instance" do - assigns[:import_task].class.should == NeptuneImport + expect(assigns[:import_task].class).to eq(NeptuneImport) end it "should assign import_task with Neptune format" do - assigns[:import_task].format.should == ImportTask.new.format + expect(assigns[:import_task].format).to eq(ImportTask.new.format) end it "should assign import_task with refrential.id" do - assigns[:import_task].referential_id.should == referential.id + expect(assigns[:import_task].referential_id).to eq(referential.id) end it "should assign import_task with logged in user id" do - assigns[:import_task].user_id.should == referential.organisation.users.first.id + expect(assigns[:import_task].user_id).to eq(referential.organisation.users.first.id) end it "should assign import_task with logged in user name" do - assigns[:import_task].user_name.should == referential.organisation.users.first.name + expect(assigns[:import_task].user_name).to eq(referential.organisation.users.first.name) end end diff --git a/spec/controllers/referentials_controller_spec.rb b/spec/controllers/referentials_controller_spec.rb index 0bed2b21d..442a10bbd 100644 --- a/spec/controllers/referentials_controller_spec.rb +++ b/spec/controllers/referentials_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe ReferentialsController do +describe ReferentialsController, :type => :controller do login_user diff --git a/spec/controllers/routes_controller_spec.rb b/spec/controllers/routes_controller_spec.rb index cfadc382a..83505effe 100644 --- a/spec/controllers/routes_controller_spec.rb +++ b/spec/controllers/routes_controller_spec.rb @@ -1,11 +1,11 @@ require 'spec_helper' -describe RoutesController do +describe RoutesController, :type => :controller do login_user let!(:route) { Factory(:route) } - it { should be_kind_of(ChouetteController) } + it { is_expected.to be_kind_of(ChouetteController) } shared_examples_for "redirected to referential_line_path(referential,line)" do it "should redirect_to referential_line_path(referential,line)" do @@ -14,16 +14,16 @@ describe RoutesController do end shared_examples_for "line and referential linked" do it "assigns route.line as @line" do - assigns[:line].should == route.line + expect(assigns[:line]).to eq(route.line) end it "assigns referential as @referential" do - assigns[:referential].should == referential + expect(assigns[:referential]).to eq(referential) end end shared_examples_for "route, line and referential linked" do it "assigns route as @route" do - assigns[:route].should == route + expect(assigns[:route]).to eq(route) end it_behaves_like "line and referential linked" end @@ -68,12 +68,12 @@ describe RoutesController do it_behaves_like "route, line and referential linked" it "assigns RouteMap.new(route) as @map" do - assigns[:map].should be_an_instance_of(RouteMap) - assigns[:map].route.should == route + expect(assigns[:map]).to be_an_instance_of(RouteMap) + expect(assigns[:map].route).to eq(route) end it "assigns route.stop_points.paginate(:page => nil) as @stop_points" do - assigns[:stop_points].should == route.stop_points.paginate(:page => nil) + expect(assigns[:stop_points]).to eq(route.stop_points.paginate(:page => nil)) end end diff --git a/spec/controllers/rule_parameter_sets_controller_spec.rb b/spec/controllers/rule_parameter_sets_controller_spec.rb index 99a522581..8615183c1 100644 --- a/spec/controllers/rule_parameter_sets_controller_spec.rb +++ b/spec/controllers/rule_parameter_sets_controller_spec.rb @@ -1,12 +1,12 @@ require 'spec_helper' -describe RuleParameterSetsController do +describe RuleParameterSetsController, :type => :controller do login_user let(:mode){"air"} shared_examples_for "referential dependant" do it "assigns referential as @referential" do - assigns[:referential].should == referential + expect(assigns[:referential]).to eq(referential) end end @@ -26,9 +26,9 @@ describe RuleParameterSetsController do it_behaves_like "referential dependant" it "should assign rule_parameter_set with default params" do RuleParameterSet.default_params.each do |k,v| - assigns[:rule_parameter_set].send( k ).should == v + expect(assigns[:rule_parameter_set].send( k )).to eq(v) end - assigns[:rule_parameter_set].referential_id.should == referential.id + expect(assigns[:rule_parameter_set].referential_id).to eq(referential.id) end end end diff --git a/spec/controllers/vehicle_journey_imports_controller_spec.rb b/spec/controllers/vehicle_journey_imports_controller_spec.rb index 091826205..d91814669 100644 --- a/spec/controllers/vehicle_journey_imports_controller_spec.rb +++ b/spec/controllers/vehicle_journey_imports_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe ImportTasksController do +describe ImportTasksController, :type => :controller do login_user |
