aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests
diff options
context:
space:
mode:
authorMichel Etienne2012-04-27 15:00:18 +0200
committerMichel Etienne2012-04-27 15:00:18 +0200
commit98ab3dc97be4d71606a985a3a587b253e0b6c685 (patch)
tree2fa77987d83a7fcd0c755f31854199d561b2f3d3 /spec/requests
parentba2527b56c76ca173a8769f1f3cbe949842c96b1 (diff)
downloadchouette-core-98ab3dc97be4d71606a985a3a587b253e0b6c685.tar.bz2
create pages for connection links and spec for timetables
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/connection_links_spec.rb60
-rw-r--r--spec/requests/time_tables_spec.rb50
2 files changed, 110 insertions, 0 deletions
diff --git a/spec/requests/connection_links_spec.rb b/spec/requests/connection_links_spec.rb
new file mode 100644
index 000000000..c40e81970
--- /dev/null
+++ b/spec/requests/connection_links_spec.rb
@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+require 'spec_helper'
+
+describe "ConnectionLinks" do
+ login_user
+
+ let!(:referential) { create(:referential).switch }
+ let!(:connection_links) { referential; Array.new(2) { create(:connection_link) } }
+ subject { connection_links.first }
+
+ describe "list" do
+ it "display connection_links" do
+ visit referential_connection_links_path(referential)
+ page.should have_content(connection_links.first.name)
+ page.should have_content(connection_links.last.name)
+ end
+
+ end
+
+ describe "show" do
+ it "display connection_link" do
+ visit referential_connection_links_path(referential)
+ click_link "#{connection_links.first.name}"
+ page.should have_content(connection_links.first.name)
+ end
+
+ it "display map" do
+ pending ": map not yet implemented"
+# subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
+# visit referential_connection_links_path(referential)
+# click_link "#{connection_links.first.name}"
+# page.should have_selector("#map", :class => 'connection_link')
+ end
+
+ end
+
+ describe "new" do
+ pending ": TODO see how to affect departure and arrival"
+# it "creates connection_link and return to show" do
+# visit referential_connection_links_path(referential)
+# click_link "Ajouter une correspondance"
+# fill_in "Nom", :with => "ConnectionLink 1"
+# fill_in "Identifiant Neptune", :with => "test:Timetable:1"
+# click_button("Créer Correspondance")
+# page.should have_content("ConnectionLink 1")
+# end
+ end
+
+ describe "edit and return to show" do
+ pending ": TODO see how to affect departure and arrival"
+# it "edit connection_link" do
+# visit referential_connection_link_path(referential, subject)
+# click_link "Modifier cette correspondance"
+# fill_in "Nom", :with => "ConnectionLink Modified"
+# click_button("Modifier Correspondance")
+# page.should have_content("ConnectionLink Modified")
+# end
+ end
+
+end
diff --git a/spec/requests/time_tables_spec.rb b/spec/requests/time_tables_spec.rb
new file mode 100644
index 000000000..720370ead
--- /dev/null
+++ b/spec/requests/time_tables_spec.rb
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+require 'spec_helper'
+
+describe "TimeTables" do
+ login_user
+
+ let!(:referential) { create(:referential).switch }
+ let!(:time_tables) { referential; Array.new(2) { create(:time_table) } }
+ subject { time_tables.first }
+
+ describe "list" do
+ it "display time_tables" do
+ visit referential_time_tables_path(referential)
+ page.should have_content(time_tables.first.comment)
+ page.should have_content(time_tables.last.comment)
+ end
+
+ end
+
+ describe "show" do
+ it "display time_table" do
+ visit referential_time_tables_path(referential)
+ click_link "#{time_tables.first.comment}"
+ page.should have_content(time_tables.first.comment)
+ end
+
+ end
+
+ describe "new" do
+ it "creates time_table and return to show" do
+ visit referential_time_tables_path(referential)
+ click_link "Ajouter un calendrier"
+ fill_in "Description", :with => "TimeTable 1"
+ fill_in "Identifiant Neptune", :with => "test:Timetable:1"
+ click_button("Créer Calendrier")
+ page.should have_content("TimeTable 1")
+ end
+ end
+
+ describe "edit and return to show" do
+ it "edit time_table" do
+ visit referential_time_table_path(referential, subject)
+ click_link "Modifier ce calendrier"
+ fill_in "Description", :with => "TimeTable Modified"
+ click_button("Modifier Calendrier")
+ page.should have_content("TimeTable Modified")
+ end
+ end
+
+end