From 297727032a0c1fddfbb9d8864deda1ec24ea36f6 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Sun, 15 May 2016 10:25:11 +0200 Subject: Associate StopAreaReferential to Referential. Create ReferentialStopAreas to manage lines in Referential. Refs #822 --- spec/features/access_points_spec.rb | 69 +++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 37 deletions(-) (limited to 'spec/features/access_points_spec.rb') 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 -- cgit v1.2.3