diff options
Diffstat (limited to 'spec/routing')
| -rw-r--r-- | spec/routing/companies_spec.rb | 25 | ||||
| -rw-r--r-- | spec/routing/group_of_lines_spec.rb | 25 | ||||
| -rw-r--r-- | spec/routing/networks_spec.rb | 25 | ||||
| -rw-r--r-- | spec/routing/time_tables_spec.rb | 31 |
4 files changed, 106 insertions, 0 deletions
diff --git a/spec/routing/companies_spec.rb b/spec/routing/companies_spec.rb new file mode 100644 index 000000000..25f86325b --- /dev/null +++ b/spec/routing/companies_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe CompaniesController do + describe "routing" do + it "not recognize #routes" do + get( "/referentials/1/companies/2/routes").should_not route_to( + :controller => "companies", :action => "routes", + :referential_id => "1", :id => "2" + ) + end + it "not recognize #lines" do + get( "/referentials/1/companies/2/lines").should_not route_to( + :controller => "companies", :action => "lines", + :referential_id => "1", :id => "2" + ) + end + it "recognize and generate #show" do + get( "/referentials/1/companies/2").should route_to( + :controller => "companies", :action => "show", + :referential_id => "1", :id => "2" + ) + end + end +end + diff --git a/spec/routing/group_of_lines_spec.rb b/spec/routing/group_of_lines_spec.rb new file mode 100644 index 000000000..ee5596cf7 --- /dev/null +++ b/spec/routing/group_of_lines_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe GroupOfLinesController do + describe "routing" do + it "not recognize #routes" do + get( "/referentials/1/group_of_lines/2/routes").should_not route_to( + :controller => "group_of_lines", :action => "routes", + :referential_id => "1", :id => "2" + ) + end + it "not recognize #lines" do + get( "/referentials/1/group_of_lines/2/lines").should_not route_to( + :controller => "group_of_lines", :action => "lines", + :referential_id => "1", :id => "2" + ) + end + it "recognize and generate #show" do + get( "/referentials/1/group_of_lines/2").should route_to( + :controller => "group_of_lines", :action => "show", + :referential_id => "1", :id => "2" + ) + end + end +end + diff --git a/spec/routing/networks_spec.rb b/spec/routing/networks_spec.rb new file mode 100644 index 000000000..c0544980d --- /dev/null +++ b/spec/routing/networks_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe NetworksController do + describe "routing" do + it "not recognize #routes" do + get( "/referentials/1/networks/2/routes").should_not route_to( + :controller => "networks", :action => "routes", + :referential_id => "1", :id => "2" + ) + end + it "not recognize #lines" do + get( "/referentials/1/networks/2/lines").should_not route_to( + :controller => "networks", :action => "lines", + :referential_id => "1", :id => "2" + ) + end + it "recognize and generate #show" do + get( "/referentials/1/networks/2").should route_to( + :controller => "networks", :action => "show", + :referential_id => "1", :id => "2" + ) + end + end +end + diff --git a/spec/routing/time_tables_spec.rb b/spec/routing/time_tables_spec.rb new file mode 100644 index 000000000..45e426f4c --- /dev/null +++ b/spec/routing/time_tables_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe TimeTablesController do + describe "routing" do + it "not recognize #routes" do + get( "/referentials/1/time_tables/2/routes").should_not route_to( + :controller => "time_tables", :action => "routes", + :referential_id => "1", :id => "2" + ) + end + it "not recognize #lines" do + get( "/referentials/1/time_tables/2/lines").should_not route_to( + :controller => "time_tables", :action => "lines", + :referential_id => "1", :id => "2" + ) + end + it "not recognize #time_table_periods" do + get( "/referentials/1/time_tables/2/time_table_periods").should_not route_to( + "time_table_periods#index", + :referential_id => "1", :time_table_id => "2" + ) + end + it "recognize and generate #show" do + get( "/referentials/1/time_tables/2").should route_to( + :controller => "time_tables", :action => "show", + :referential_id => "1", :id => "2" + ) + end + end +end + |
