aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAlban Peignier2016-05-15 10:25:11 +0200
committerAlban Peignier2016-05-15 10:25:11 +0200
commit297727032a0c1fddfbb9d8864deda1ec24ea36f6 (patch)
tree62868de1770546b748b5fec3c59e806cbe5c8f21 /spec
parentaffbacfcd955230f66badb261dcc462cca9cd0b9 (diff)
downloadchouette-core-297727032a0c1fddfbb9d8864deda1ec24ea36f6.tar.bz2
Associate StopAreaReferential to Referential. Create ReferentialStopAreas to manage lines in Referential. Refs #822
Diffstat (limited to 'spec')
-rw-r--r--spec/features/access_points_spec.rb69
-rw-r--r--spec/features/routes_spec.rb97
-rw-r--r--spec/features/stop_areas_spec.rb23
3 files changed, 89 insertions, 100 deletions
diff --git a/spec/features/access_points_spec.rb b/spec/features/access_points_spec.rb
index c0f9a157a..a78545ee4 100644
--- a/spec/features/access_points_spec.rb
+++ b/spec/features/access_points_spec.rb
@@ -4,7 +4,6 @@ require 'spec_helper'
describe "Access points", :type => :feature do
login_user
- let(:stop_area_referential) { stop_area.stop_area_referential }
let!(:stop_area) { create(:stop_area) }
let!(:access_points) { Array.new(2) { create(:access_point, :stop_area => stop_area) } }
subject { access_points.first }
@@ -23,46 +22,42 @@ describe "Access points", :type => :feature do
describe "show" do
- # FIXME #821
- # it "displays an access point" do
- # access_points.each do |ap|
- # visit stop_area_referential_stop_area_path(stop_area_referential, stop_area)
- # click_link ap.name
- # expect(page).to have_content(ap.name)
- # end
- # end
+ it "displays an access point" do
+ access_points.each do |ap|
+ visit referential_stop_area_path(referential, stop_area)
+ click_link ap.name
+ expect(page).to have_content(ap.name)
+ end
+ end
- # FIXME #821
- # it "displays a map" do
- # access_points.each do |ap|
- # visit stop_area_referential_stop_area_path(stop_area_referential, stop_area)
- # click_link ap.name
- # expect(page).to have_selector("#map.access_point")
- # end
- # end
+ it "displays a map" do
+ access_points.each do |ap|
+ visit referential_stop_area_path(referential, stop_area)
+ click_link ap.name
+ expect(page).to have_selector("#map.access_point")
+ end
+ end
end
- # FIXME #821
- # describe "new" do
- # it "creates an access point" do
- # visit stop_area_referential_stop_area_path(stop_area_referential, stop_area)
- # click_link I18n.t("access_points.actions.new")
- # fill_in "access_point[name]", :with => "My Access Point Name"
- # click_button(I18n.t('formtastic.create',model: I18n.t('activerecord.models.access_point.one')))
- # expect(page).to have_content("My Access Point Name")
- # end
- # end
+ describe "new" do
+ it "creates an access point" do
+ visit referential_stop_area_path(referential, stop_area)
+ click_link I18n.t("access_points.actions.new")
+ fill_in "access_point[name]", :with => "My Access Point Name"
+ click_button(I18n.t('formtastic.create',model: I18n.t('activerecord.models.access_point.one')))
+ expect(page).to have_content("My Access Point Name")
+ end
+ end
- # FIXME #821
- # describe "edit" do
- # it "edits an acess point" do
- # visit stop_area_referential_stop_area_access_point_path(stop_area_referential, stop_area, subject)
- # click_link I18n.t("access_points.actions.edit")
- # fill_in "access_point[name]", :with => "My New Access Point Name"
- # click_button(I18n.t('formtastic.update',model: I18n.t('activerecord.models.access_point.one')))
- # expect(page).to have_content("My New Access Point Name")
- # end
- # end
+ describe "edit" do
+ it "edits an acess point" do
+ visit referential_stop_area_access_point_path(referential, stop_area, subject)
+ click_link I18n.t("access_points.actions.edit")
+ fill_in "access_point[name]", :with => "My New Access Point Name"
+ click_button(I18n.t('formtastic.update',model: I18n.t('activerecord.models.access_point.one')))
+ expect(page).to have_content("My New Access Point Name")
+ end
+ end
end
diff --git a/spec/features/routes_spec.rb b/spec/features/routes_spec.rb
index 25bb1680c..c50ff50bc 100644
--- a/spec/features/routes_spec.rb
+++ b/spec/features/routes_spec.rb
@@ -10,61 +10,56 @@ describe "Routes", :type => :feature do
#let!(:stop_areas) { Array.new(4) { create(:stop_area) } }
let!(:stop_points) { Array.new(4) { create(:stop_point, :route => route) } }
- # FIXME #825
- # describe "from lines page to a line page" do
- # it "display line's routes" do
- # visit referential_lines_path(referential)
- # click_link "#{line.name}"
- # expect(page).to have_content(route.name)
- # expect(page).to have_content(route2.name)
- # end
- # end
+ describe "from lines page to a line page" do
+ it "display line's routes" do
+ visit referential_lines_path(referential)
+ click_link "#{line.name}"
+ expect(page).to have_content(route.name)
+ expect(page).to have_content(route2.name)
+ end
+ end
- # FIXME #825
- # describe "from line's page to route's page" do
- # it "display route properties" do
- # visit referential_line_path(referential,line)
- # click_link "#{route.name}"
- # expect(page).to have_content(route.name)
- # expect(page).to have_content(route.number)
- # end
- # end
+ describe "from line's page to route's page" do
+ it "display route properties" do
+ visit referential_line_path(referential,line)
+ click_link "#{route.name}"
+ expect(page).to have_content(route.name)
+ expect(page).to have_content(route.number)
+ end
+ end
- # FIXME #825
- # describe "from line's page, create a new route" do
- # it "return to line's page that display new route" do
- # visit referential_line_path(referential,line)
- # click_link "Ajouter une séquence d'arrêts"
- # fill_in "route_name", :with => "A to B"
- # fill_in "Indice", :with => "AB"
- # select 'aller', :from => "route_direction_code"
- # select 'aller', :from => "route_wayback_code"
- # click_button("Créer séquence d'arrêts")
- # expect(page).to have_content("A to B")
- # end
- # end
+ describe "from line's page, create a new route" do
+ it "return to line's page that display new route" do
+ visit referential_line_path(referential,line)
+ click_link "Ajouter une séquence d'arrêts"
+ fill_in "route_name", :with => "A to B"
+ fill_in "Indice", :with => "AB"
+ select 'aller', :from => "route_direction_code"
+ select 'aller', :from => "route_wayback_code"
+ click_button("Créer séquence d'arrêts")
+ expect(page).to have_content("A to B")
+ end
+ end
- # FIXME #825
- # describe "from line's page, select a route and edit it" do
- # it "return to line's page with changed name" do
- # visit referential_line_path(referential,line)
- # click_link "#{route.name}"
- # click_link "Modifier cette séquence d'arrêts"
- # fill_in "route_name", :with => "#{route.name}-changed"
- # click_button("Modifier séquence d'arrêts")
- # expect(page).to have_content("#{route.name}-changed")
- # end
- # end
+ describe "from line's page, select a route and edit it" do
+ it "return to line's page with changed name" do
+ visit referential_line_path(referential,line)
+ click_link "#{route.name}"
+ click_link "Modifier cette séquence d'arrêts"
+ fill_in "route_name", :with => "#{route.name}-changed"
+ click_button("Modifier séquence d'arrêts")
+ expect(page).to have_content("#{route.name}-changed")
+ end
+ end
- # FIXME #825
- # describe "from line's page, select a route and delete it" do
- # it "return to line's page without route name" do
- # visit referential_line_path(referential,line)
- # click_link "#{route.name}"
- # click_link "Supprimer cette séquence d'arrêts"
- # expect(page).not_to have_content(route.name)
- # end
- # end
+ describe "from line's page, select a route and delete it" do
+ it "return to line's page without route name" do
+ visit referential_line_path(referential,line)
+ click_link "#{route.name}"
+ click_link "Supprimer cette séquence d'arrêts"
+ expect(page).not_to have_content(route.name)
+ end
+ end
describe "from route's page, select edit boarding/alighting and update it" do
it "Edits boarding/alighting properties on route stops" do
diff --git a/spec/features/stop_areas_spec.rb b/spec/features/stop_areas_spec.rb
index 0c5684a5b..c71f09e63 100644
--- a/spec/features/stop_areas_spec.rb
+++ b/spec/features/stop_areas_spec.rb
@@ -31,18 +31,17 @@ describe "StopAreas", :type => :feature do
end
- # FIXME #822
- # describe "new" do
- # it "creates stop_area and return to show" do
- # visit stop_area_referential_stop_areas_path(stop_area_referential)
- # click_link "Ajouter un arrêt"
- # fill_in "stop_area_name", :with => "StopArea 1"
- # fill_in "Numéro d'enregistrement", :with => "test-1"
- # fill_in "Identifiant Neptune", :with => "test:StopArea:1"
- # click_button("Créer arrêt")
- # expect(page).to have_content("StopArea 1")
- # end
- # end
+ describe "new" do
+ it "creates stop_area and return to show" do
+ visit stop_area_referential_stop_areas_path(stop_area_referential)
+ click_link "Ajouter un arrêt"
+ fill_in "stop_area_name", :with => "StopArea 1"
+ fill_in "Numéro d'enregistrement", :with => "test-1"
+ fill_in "Identifiant Neptune", :with => "test:StopArea:1"
+ click_button("Créer arrêt")
+ expect(page).to have_content("StopArea 1")
+ end
+ end
describe "edit and return to show" do
it "edit stop_area" do