diff options
| author | jpl | 2017-02-23 16:33:54 +0100 |
|---|---|---|
| committer | jpl | 2017-02-23 16:33:54 +0100 |
| commit | d6c447cc7524a5f20681a0565649f5cbfbaa70d4 (patch) | |
| tree | 692578eb9e13ecdfc1564cc6c0532b0c70712080 | |
| parent | bb75e3efb7de3d37439285722aca49d4cef77ad5 (diff) | |
| download | chouette-core-d6c447cc7524a5f20681a0565649f5cbfbaa70d4.tar.bz2 | |
Fix tests
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 2 | ||||
| -rw-r--r-- | app/views/referential_lines/show.html.slim | 2 | ||||
| -rw-r--r-- | app/views/routing_constraint_zones/_form.html.slim | 4 | ||||
| -rw-r--r-- | spec/features/routes_spec.rb | 2 | ||||
| -rw-r--r-- | spec/features/vehicle_journey_imports_spec.rb | 2 | ||||
| -rw-r--r-- | spec/models/chouette/route_spec.rb | 2 |
6 files changed, 8 insertions, 6 deletions
diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index 194672c73..49b717beb 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -50,6 +50,7 @@ module NewapplicationHelper if current_referential lnk << current_referential lnk << item.line if item.respond_to? :line + lnk << item if item.class.to_s == 'Chouette::RoutingConstraintZone' lnk << item if item.respond_to? :line_referential lnk << item.stop_area if item.respond_to? :stop_area lnk << item if item.respond_to? :stop_points @@ -100,6 +101,7 @@ module NewapplicationHelper if current_referential polymorph_url << current_referential polymorph_url << item.line if item.respond_to? :line + polymorph_url << item if item.class.to_s == 'Chouette::RoutingConstraintZone' polymorph_url << item if item.respond_to? :line_referential polymorph_url << item.stop_area if item.respond_to? :stop_area polymorph_url << item if item.respond_to? :stop_points diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim index 3bf9a11a2..a0d997cfa 100644 --- a/app/views/referential_lines/show.html.slim +++ b/app/views/referential_lines/show.html.slim @@ -60,7 +60,7 @@ - if @routes.any? .row - .col-lg-12 + .col-lg-12 = table_builder @routes, { @routes.human_attribute_name(:number) => 'number', @routes.human_attribute_name(:name) => 'name', 'Arrêt de départ' => Proc.new{|r| r.try(:stop_points).first.try(:stop_area).try(:name)}, diff --git a/app/views/routing_constraint_zones/_form.html.slim b/app/views/routing_constraint_zones/_form.html.slim index d9e243746..5f33e2649 100644 --- a/app/views/routing_constraint_zones/_form.html.slim +++ b/app/views/routing_constraint_zones/_form.html.slim @@ -4,10 +4,10 @@ = f.input :name, label: t('activerecord.models.attributes.routing_constraint_zone.name') .row .col-lg-6.col-sm-12 - = f.input :stop_area_ids, as: :select, collection: Chouette::StopArea.all, selected: @routing_constraint_zone.stop_area_ids, label: Chouette::StopArea.model_name.human.pluralize.capitalize, label_method: :name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Sélection de arrêts', 'multiple': 'multiple', style: 'width: 100%' } + / Temporarily limit the collection to 10 items... otherwise it kills RoR + = f.input :stop_area_ids, as: :select, collection: Chouette::StopArea.limit(10), selected: @routing_constraint_zone.stop_area_ids, label: Chouette::StopArea.model_name.human.pluralize.capitalize, label_method: :name, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Sélection de arrêts', 'multiple': 'multiple', style: 'width: 100%' } .row .col-lg-12.text-right = link_to 'Annuler', :back, class: 'btn btn-link' = f.button :submit, class: 'btn btn-danger' - diff --git a/spec/features/routes_spec.rb b/spec/features/routes_spec.rb index 9bfb070c1..0cdeaddb4 100644 --- a/spec/features/routes_spec.rb +++ b/spec/features/routes_spec.rb @@ -37,7 +37,7 @@ describe "Routes", :type => :feature do click_link "Ajouter un itinéraire" fill_in "route_name", :with => "A to B" # select 'Aller', :from => "route_direction" - select 'Aller', :from => "route_wayback" + check('route[wayback]') click_button("Enregistrer") expect(page).to have_content("A to B") end diff --git a/spec/features/vehicle_journey_imports_spec.rb b/spec/features/vehicle_journey_imports_spec.rb index 262d585f2..fe1fc74f3 100644 --- a/spec/features/vehicle_journey_imports_spec.rb +++ b/spec/features/vehicle_journey_imports_spec.rb @@ -49,7 +49,7 @@ describe "VehicleJourneyImports", :type => :feature do attach_file('Fichier', valid_file_path) click_button "Lancer l'import" expect(page).to have_content(I18n.t("vehicle_journey_imports.new.success")) - expect(page).to have_content("Itinéraire #{route.name}") + expect(page).to have_content(route.name) end it "should return error messages when file is invalid" do diff --git a/spec/models/chouette/route_spec.rb b/spec/models/chouette/route_spec.rb index 0392485d8..7bd89703c 100644 --- a/spec/models/chouette/route_spec.rb +++ b/spec/models/chouette/route_spec.rb @@ -104,7 +104,7 @@ describe Chouette::Route, :type => :model do it "should have swap stop_points from route" do subject.update_attributes( :stop_points_attributes => swapped_stop_hash) - expect(Chouette::Route.find( subject.id ).stop_points.map(&:id)).to eq(new_stop_id_list) + expect(Chouette::Route.find(subject.id).stop_points.map(&:id).sort).to eq(new_stop_id_list.sort) end it "should have swap stop_points from route's journey pattern" do subject.update_attributes( :stop_points_attributes => swapped_stop_hash) |
