aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests/lines_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/lines_spec.rb')
-rw-r--r--spec/requests/lines_spec.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/spec/requests/lines_spec.rb b/spec/requests/lines_spec.rb
index 10d653f30..b851f522a 100644
--- a/spec/requests/lines_spec.rb
+++ b/spec/requests/lines_spec.rb
@@ -4,14 +4,13 @@ require 'spec_helper'
describe "Lines" do
login_user
- let(:network) { Factory(:network) }
- let(:company) { Factory(:company) }
- let(:lines) { referential; Array.new(2) { Factory(:line, :network => network, :company => company) } }
+ let!(:network) { Factory(:network) }
+ let!(:company) { Factory(:company) }
+ let!(:lines) { Array.new(2) { Factory(:line_with_stop_areas, :network => network, :company => company) } }
subject { lines.first }
describe "list" do
it "display lines" do
- pending
visit referential_lines_path(referential)
page.should have_content(lines.first.name)
page.should have_content(lines.last.name)
@@ -22,16 +21,12 @@ describe "Lines" do
describe "show" do
it "display line" do
- pending
- subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_lines_path(referential)
click_link "#{lines.first.name}"
page.should have_content(lines.first.name)
end
it "display map" do
- pending
- subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_lines_path(referential)
click_link "#{lines.first.name}"
page.should have_selector("#map", :class => 'line')
@@ -41,13 +36,11 @@ describe "Lines" do
describe "new" do
it "creates line and return to show" do
- pending
- subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_lines_path(referential)
click_link "Ajouter une ligne"
fill_in "Nom", :with => "Line 1"
- fill_in "Numéro d'enregistrement", :with => "test-1"
- fill_in "Identifiant Neptune", :with => "test:Line:1"
+ fill_in "Numéro d'enregistrement", :with => "1"
+ fill_in "Identifiant Neptune", :with => "test:Line:999"
click_button("Créer ligne")
page.should have_content("Line 1")
end
@@ -55,8 +48,6 @@ describe "Lines" do
describe "edit and return to show" do
it "edit line" do
- pending
- subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_line_path(referential, subject)
click_link "Modifier cette ligne"
fill_in "Nom", :with => "Line Modified"