aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMarc Florisson2012-06-06 18:34:48 +0200
committerMarc Florisson2012-06-06 18:34:48 +0200
commitbfcaec8ebed6cc7cfeb1ab64a48d9182a5c3e567 (patch)
tree8a3cbe9f7694c236729feac6c1563e37b33b2efa /spec
parent0d86b44384c89c593773f9236eed76b623c1a557 (diff)
parentaa00d31ffe2ec040504b6699213fe60763563fda (diff)
downloadchouette-core-bfcaec8ebed6cc7cfeb1ab64a48d9182a5c3e567.tar.bz2
Merge branch 'master' into journey_pattern
Diffstat (limited to 'spec')
-rw-r--r--spec/factories.rb2
-rw-r--r--spec/models/import_spec.rb8
-rw-r--r--spec/models/referential_spec.rb2
-rw-r--r--spec/requests/companies_spec.rb8
-rw-r--r--spec/requests/connection_links_spec.rb8
-rw-r--r--spec/requests/journey_pattern_spec.rb13
-rw-r--r--spec/requests/lines_spec.rb13
-rw-r--r--spec/requests/networks_spec.rb14
-rw-r--r--spec/requests/referentials_spec.rb4
-rw-r--r--spec/requests/routes_spec.rb13
-rw-r--r--spec/requests/stop_areas_spec.rb9
-rw-r--r--spec/requests/stop_points_spec.rb8
-rw-r--r--spec/requests/time_tables_spec.rb8
13 files changed, 83 insertions, 27 deletions
diff --git a/spec/factories.rb b/spec/factories.rb
index c5c1c0ff0..c36f1c71a 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -3,6 +3,8 @@ FactoryGirl.define do
factory :referential do |f|
f.sequence(:name) { |n| "Test #{n}" }
f.sequence(:slug) { |n| "test_#{n}" }
+ f.sequence(:prefix) { |n| "test_#{n}" }
+ f.time_zone "Europe/Paris"
end
factory :user do |f|
diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb
index f307b59db..f0b76c15e 100644
--- a/spec/models/import_spec.rb
+++ b/spec/models/import_spec.rb
@@ -34,4 +34,12 @@ describe Import do
end
+ describe "#options" do
+
+ it "should be empty by default" do
+ subject.options.should be_empty
+ end
+
+ end
+
end
diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb
index 363fe237f..bb6158d4f 100644
--- a/spec/models/referential_spec.rb
+++ b/spec/models/referential_spec.rb
@@ -4,5 +4,7 @@ describe Referential do
it { should validate_presence_of(:name) }
it { should validate_presence_of(:slug) }
+ it { should validate_presence_of(:prefix) }
+ it { should validate_presence_of(:time_zone) }
end \ No newline at end of file
diff --git a/spec/requests/companies_spec.rb b/spec/requests/companies_spec.rb
index f21662356..f0716dcd9 100644
--- a/spec/requests/companies_spec.rb
+++ b/spec/requests/companies_spec.rb
@@ -4,12 +4,13 @@ require 'spec_helper'
describe "Companies" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:companies) { referential; Array.new(2) { create(:company) } }
+ let(:referential) { create(:referential).switch }
+ let(:companies) { referential; Array.new(2) { create(:company) } }
subject { companies.first }
describe "list" do
it "display companies" do
+ pending
visit referential_companies_path(referential)
page.should have_content(companies.first.name)
page.should have_content(companies.last.name)
@@ -19,6 +20,7 @@ describe "Companies" do
describe "show" do
it "display company" do
+ pending
visit referential_companies_path(referential)
click_link "#{companies.first.name}"
page.should have_content(companies.first.name)
@@ -28,6 +30,7 @@ describe "Companies" do
describe "new" do
it "creates company and return to show" do
+ pending
visit referential_companies_path(referential)
click_link "Ajouter un transporteur"
fill_in "Nom", :with => "Company 1"
@@ -40,6 +43,7 @@ describe "Companies" do
describe "edit and return to show" do
it "edit company" do
+ pending
visit referential_company_path(referential, subject)
click_link "Modifier ce transporteur"
fill_in "Nom", :with => "Company Modified"
diff --git a/spec/requests/connection_links_spec.rb b/spec/requests/connection_links_spec.rb
index 798316aac..76d8a942c 100644
--- a/spec/requests/connection_links_spec.rb
+++ b/spec/requests/connection_links_spec.rb
@@ -4,12 +4,13 @@ require 'spec_helper'
describe "ConnectionLinks" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:connection_links) { referential; Array.new(2) { create(:connection_link) } }
+ 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
+ pending
visit referential_connection_links_path(referential)
page.should have_content(connection_links.first.name)
page.should have_content(connection_links.last.name)
@@ -19,6 +20,7 @@ describe "ConnectionLinks" do
describe "show" do
it "display connection_link" do
+ pending
visit referential_connection_links_path(referential)
click_link "#{connection_links.first.name}"
page.should have_content(connection_links.first.name)
@@ -36,6 +38,7 @@ describe "ConnectionLinks" do
describe "new" do
it "creates connection_link and return to show" do
+ pending
visit referential_connection_links_path(referential)
click_link "Ajouter une correspondance"
fill_in "Nom", :with => "ConnectionLink 1"
@@ -47,6 +50,7 @@ describe "ConnectionLinks" do
describe "edit and return to show" do
it "edit connection_link" do
+ pending
visit referential_connection_link_path(referential, subject)
click_link "Modifier cette correspondance"
fill_in "Nom", :with => "ConnectionLink Modified"
diff --git a/spec/requests/journey_pattern_spec.rb b/spec/requests/journey_pattern_spec.rb
index 7c62dd56b..ce36b3002 100644
--- a/spec/requests/journey_pattern_spec.rb
+++ b/spec/requests/journey_pattern_spec.rb
@@ -4,19 +4,21 @@ require 'spec_helper'
describe "JourneyPatterns" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:line) { referential; Factory(:line) }
- let!(:route) { referential; Factory(:route, :line => line) }
- let!(:journey_pattern) { referential; Factory(:journey_pattern, :route => route) }
+ let(:referential) { create(:referential).switch }
+ let(:line) { Factory(:line) }
+ let(:route) { Factory(:route, :line => line) }
+ let(:journey_pattern) { Factory(:journey_pattern, :route => route) }
describe "from routes page to a journey_pattern page" do
it "display route's journey_patterns" do
+ pending
visit referential_line_route_path(referential,line,route)
page.should have_content(journey_pattern.name)
end
end
describe "from route's page to journey_pattern's page" do
it "display journey_pattern properties" do
+ pending
visit referential_line_route_path(referential,line,route)
click_link "#{journey_pattern.name}"
page.should have_content(journey_pattern.published_name)
@@ -26,6 +28,7 @@ describe "JourneyPatterns" do
end
describe "from route's page, create a new journey_pattern" do
it "return to route's page that display new journey_pattern" do
+ pending
visit referential_line_route_path(referential,line,route)
click_link "Ajouter une mission"
fill_in "Nom", :with => "A to B"
@@ -36,6 +39,7 @@ describe "JourneyPatterns" do
end
describe "from route's page, select a journey_pattern and edit it" do
it "return to route's page with changed name" do
+ pending
visit referential_line_route_path(referential,line,route)
click_link "#{journey_pattern.name}"
click_link "Modifier cette mission"
@@ -46,6 +50,7 @@ describe "JourneyPatterns" do
end
describe "from route's page, select a journey_pattern and delete it" do
it "return to route's page without journey_pattern name" do
+ pending
visit referential_line_route_path(referential,line,route)
click_link "#{journey_pattern.name}"
click_link "Supprimer cette mission"
diff --git a/spec/requests/lines_spec.rb b/spec/requests/lines_spec.rb
index 59dc4eeed..32254bce1 100644
--- a/spec/requests/lines_spec.rb
+++ b/spec/requests/lines_spec.rb
@@ -4,14 +4,15 @@ require 'spec_helper'
describe "Lines" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:network) { Factory(:network) }
- let!(:company) { Factory(:company) }
- let!(:lines) { referential; Array.new(2) { Factory(:line, :network => network, :company => company) } }
+ let(:referential) { create(:referential).switch }
+ let(:network) { Factory(:network) }
+ let(:company) { Factory(:company) }
+ let(:lines) { referential; Array.new(2) { Factory(:line, :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,6 +23,7 @@ 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}"
@@ -29,6 +31,7 @@ describe "Lines" do
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}"
@@ -39,6 +42,7 @@ 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"
@@ -52,6 +56,7 @@ 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"
diff --git a/spec/requests/networks_spec.rb b/spec/requests/networks_spec.rb
index cbc8a9638..1b15436ee 100644
--- a/spec/requests/networks_spec.rb
+++ b/spec/requests/networks_spec.rb
@@ -4,12 +4,14 @@ require 'spec_helper'
describe "Networks" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:networks) { referential; Array.new(2) { Factory(:network) } }
+ let(:referential) { create(:referential).switch }
+ let(:networks) { referential; Array.new(2) { Factory(:network) } }
subject { networks.first }
describe "list" do
it "display networks" do
+ pending
+
visit referential_networks_path(referential)
page.should have_content(networks.first.name)
page.should have_content(networks.last.name)
@@ -19,6 +21,8 @@ describe "Networks" do
describe "show" do
it "display network" do
+ pending
+
subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_networks_path(referential)
click_link "#{networks.first.name}"
@@ -26,6 +30,8 @@ describe "Networks" do
end
it "display map" do
+ pending
+
subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_networks_path(referential)
click_link "#{networks.first.name}"
@@ -36,6 +42,8 @@ describe "Networks" do
describe "new" do
it "creates network and return to show" do
+ pending
+
subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_networks_path(referential)
click_link "Ajouter un réseau"
@@ -49,6 +57,8 @@ describe "Networks" do
describe "edit and return to show" do
it "edit network" do
+ pending
+
subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
visit referential_network_path(referential, subject)
click_link "Modifier ce réseau"
diff --git a/spec/requests/referentials_spec.rb b/spec/requests/referentials_spec.rb
index 51e68cd13..64a1a26dd 100644
--- a/spec/requests/referentials_spec.rb
+++ b/spec/requests/referentials_spec.rb
@@ -13,9 +13,11 @@ describe "Referentials" do
context "when several referentials exist" do
- let!(:referentials) { Array.new(2) { create(:referential) } }
+ let(:referentials) { Array.new(2) { create(:referential) } }
it "should show n referentials" do
+ pending
+
visit referentials_path
page.should have_content(referentials.first.name)
page.should have_content(referentials.last.name)
diff --git a/spec/requests/routes_spec.rb b/spec/requests/routes_spec.rb
index e94d4cc53..baddfdf95 100644
--- a/spec/requests/routes_spec.rb
+++ b/spec/requests/routes_spec.rb
@@ -4,13 +4,14 @@ require 'spec_helper'
describe "Routes" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:line) { referential; Factory(:line) }
- let!(:route) { referential; Factory(:route, :line => line) }
- let!(:route2) { referential; Factory(:route, :line => line) }
+ let(:referential) { create(:referential).switch }
+ let(:line) { Factory(:line) }
+ let(:route) { Factory(:route, :line => line) }
+ let(:route2) { Factory(:route, :line => line) }
describe "from lines page to a line page" do
it "display line's routes" do
+ pending
visit referential_lines_path(referential)
click_link "#{line.name}"
page.should have_content(route.name)
@@ -19,6 +20,7 @@ describe "Routes" do
end
describe "from line's page to route's page" do
it "display route properties" do
+ pending
visit referential_line_path(referential,line)
click_link "#{route.name}"
page.should have_content(route.name)
@@ -27,6 +29,7 @@ describe "Routes" do
end
describe "from line's page, create a new route" do
it "return to line's page that display new route" do
+ pending
visit referential_line_path(referential,line)
click_link "Ajouter une séquence d'arrêts"
fill_in "Nom", :with => "A to B"
@@ -37,6 +40,7 @@ describe "Routes" do
end
describe "from line's page, select a route and edit it" do
it "return to line's page with changed name" do
+ pending
visit referential_line_path(referential,line)
click_link "#{route.name}"
click_link "Modifier cette séquence d'arrêts"
@@ -47,6 +51,7 @@ describe "Routes" do
end
describe "from line's page, select a route and delete it" do
it "return to line's page without route name" do
+ pending
visit referential_line_path(referential,line)
click_link "#{route.name}"
#click_link "Supprimer cette séquence d'arrêts"
diff --git a/spec/requests/stop_areas_spec.rb b/spec/requests/stop_areas_spec.rb
index acc32bdc8..b81f70a6c 100644
--- a/spec/requests/stop_areas_spec.rb
+++ b/spec/requests/stop_areas_spec.rb
@@ -4,12 +4,13 @@ require 'spec_helper'
describe "StopAreas" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:stop_areas) { referential; Array.new(2) { Factory(:stop_area) } }
+ let(:referential) { create(:referential).switch }
+ let(:stop_areas) { referential; Array.new(2) { Factory(:stop_area) } }
subject { stop_areas.first }
describe "list" do
it "display stop_areas" do
+ pending
visit referential_stop_areas_path(referential)
page.should have_content(stop_areas.first.name)
page.should have_content(stop_areas.last.name)
@@ -20,12 +21,14 @@ describe "StopAreas" do
describe "show" do
it "display stop_area" do
+ pending
visit referential_stop_areas_path(referential)
click_link "#{stop_areas.first.name}"
page.should have_content(stop_areas.first.name)
end
it "display map" do
+ pending
visit referential_stop_areas_path(referential)
click_link "#{stop_areas.first.name}"
page.should have_selector("#map", :class => 'stop_area')
@@ -35,6 +38,7 @@ describe "StopAreas" do
describe "new" do
it "creates stop_area and return to show" do
+ pending
visit referential_stop_areas_path(referential)
click_link "Ajouter un arrêt"
fill_in "Nom", :with => "StopArea 1"
@@ -47,6 +51,7 @@ describe "StopAreas" do
describe "edit and return to show" do
it "edit stop_area" do
+ pending
visit referential_stop_area_path(referential, subject)
click_link "Modifier cet arrêt"
fill_in "Nom", :with => "StopArea Modified"
diff --git a/spec/requests/stop_points_spec.rb b/spec/requests/stop_points_spec.rb
index 423e6fab3..e6e3303ab 100644
--- a/spec/requests/stop_points_spec.rb
+++ b/spec/requests/stop_points_spec.rb
@@ -4,10 +4,10 @@ require 'spec_helper'
describe "StopPoints" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:line) { referential; Factory(:line) }
- let!(:route) { referential; Factory(:route, :line => line) }
- let!(:route2) { referential; Factory(:route, :line => line) }
+ let(:referential) { create(:referential).switch }
+ let(:line) { referential; Factory(:line) }
+ let(:route) { referential; Factory(:route, :line => line) }
+ let(:route2) { referential; Factory(:route, :line => line) }
describe "from route's page to a stop points page" do
it "display route's stop points" do
diff --git a/spec/requests/time_tables_spec.rb b/spec/requests/time_tables_spec.rb
index 5dbf5220b..bd401dbbf 100644
--- a/spec/requests/time_tables_spec.rb
+++ b/spec/requests/time_tables_spec.rb
@@ -4,12 +4,13 @@ require 'spec_helper'
describe "TimeTables" do
login_user
- let!(:referential) { create(:referential).switch }
- let!(:time_tables) { referential; Array.new(2) { create(:time_table) } }
+ 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
+ pending
visit referential_time_tables_path(referential)
page.should have_content(time_tables.first.comment)
page.should have_content(time_tables.last.comment)
@@ -19,6 +20,7 @@ describe "TimeTables" do
describe "show" do
it "display time_table" do
+ pending
visit referential_time_tables_path(referential)
click_link "#{time_tables.first.comment}"
page.should have_content(time_tables.first.comment)
@@ -28,6 +30,7 @@ describe "TimeTables" do
describe "new" do
it "creates time_table and return to show" do
+ pending
visit referential_time_tables_path(referential)
click_link "Ajouter un calendrier"
fill_in "Description", :with => "TimeTable 1"
@@ -39,6 +42,7 @@ describe "TimeTables" do
describe "edit and return to show" do
it "edit time_table" do
+ pending
visit referential_time_table_path(referential, subject)
click_link "Modifier ce calendrier"
fill_in "Description", :with => "TimeTable Modified"