aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/lines_spec.rb
diff options
context:
space:
mode:
authorAlban Peignier2016-05-13 11:56:54 +0200
committerAlban Peignier2016-05-13 11:56:54 +0200
commit6e28e49262ede9c57a6c5726570a4921f4b63d04 (patch)
tree31a26a03e2c1dd3af796c9854918d112ad6e97c8 /spec/features/lines_spec.rb
parent781142afdb90bb0ca62783435f582725794f4f57 (diff)
downloadchouette-core-6e28e49262ede9c57a6c5726570a4921f4b63d04.tar.bz2
Refactor models and controllers to manage Lines in LineReferential. Refs #825
Diffstat (limited to 'spec/features/lines_spec.rb')
-rw-r--r--spec/features/lines_spec.rb31
1 files changed, 16 insertions, 15 deletions
diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb
index cdf38f97a..91185c22e 100644
--- a/spec/features/lines_spec.rb
+++ b/spec/features/lines_spec.rb
@@ -4,39 +4,40 @@ require 'spec_helper'
describe "Lines", :type => :feature do
login_user
+ let(:line_referential) { create :line_referential }
let!(:network) { create(:network) }
let!(:company) { create(:company) }
- let!(:lines) { Array.new(2) { create(:line_with_stop_areas, :network => network, :company => company) } }
- let!(:group_of_line) { create(:group_of_line) }
+ let!(:lines) { Array.new(2) { create :line_with_stop_areas, network: network, company: company, line_referential: line_referential } }
+ let!(:group_of_line) { create(:group_of_line) }
subject { lines.first }
describe "list" do
it "display lines" do
- visit referential_lines_path(referential)
+ visit line_referential_lines_path(line_referential)
expect(page).to have_content(lines.first.name)
expect(page).to have_content(lines.last.name)
end
-
- end
- describe "show" do
+ end
+
+ describe "show" do
it "display line" do
- visit referential_lines_path(referential)
+ visit line_referential_lines_path(line_referential)
click_link "#{lines.first.name}"
expect(page).to have_content(lines.first.name)
end
it "display map" do
- visit referential_lines_path(referential)
+ visit line_referential_lines_path(line_referential)
click_link "#{lines.first.name}"
expect(page).to have_selector("#map.line")
end
-
+
end
- describe "new" do
+ describe "new" do
it "creates line and return to show" do
- visit referential_lines_path(referential)
+ visit line_referential_lines_path(line_referential)
click_link "Ajouter une ligne"
fill_in "line_name", :with => "Line 1"
fill_in "Numéro d'enregistrement", :with => "1"
@@ -46,9 +47,9 @@ describe "Lines", :type => :feature do
end
end
- describe "new with group of line", :js => true do
+ describe "new with group of line", :js => true do
it "creates line and return to show" do
- visit new_referential_line_path(referential)
+ visit new_line_referential_line_path(line_referential)
fill_in "line_name", :with => "Line 1"
fill_in "Numéro d'enregistrement", :with => "1"
fill_in "Identifiant Neptune", :with => "test:Line:999"
@@ -59,9 +60,9 @@ describe "Lines", :type => :feature do
end
end
- describe "edit and return to show" do
+ describe "edit and return to show" do
it "edit line" do
- visit referential_line_path(referential, subject)
+ visit line_referential_line_path(line_referential, subject)
click_link "Modifier cette ligne"
fill_in "line_name", :with => "Line Modified"
fill_in "Numéro d'enregistrement", :with => "test-1"