aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-08-07 11:45:03 +0200
committerRobert2017-08-11 10:03:46 +0200
commit05417c824f043665cb46d9f837aaf66cd8b787e4 (patch)
tree0cd1cdf119fd531c800b9802dd2609ea40a5bd1f
parent70c04d2727179308e98d704c78a668c425b223b9 (diff)
downloadchouette-core-05417c824f043665cb46d9f837aaf66cd8b787e4.tar.bz2
Add routes to Routes#duplicate
A couple of new routes for a form that will allow us to duplicate an itinéraire/route inside a line. Refs #4189
-rw-r--r--app/controllers/routes_controller.rb3
-rw-r--r--config/routes.rb2
-rw-r--r--spec/routing/routes_routing_spec.rb11
3 files changed, 16 insertions, 0 deletions
diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb
index 7ba2c1a58..6455cb2da 100644
--- a/app/controllers/routes_controller.rb
+++ b/app/controllers/routes_controller.rb
@@ -69,6 +69,9 @@ class RoutesController < ChouetteController
end
end
+ def duplicate
+ end
+
# def update
# update! do |success, failure|
# success.html { redirect_to referential_line_path(@referential,@line) }
diff --git a/config/routes.rb b/config/routes.rb
index 0ed401cf5..b738c0943 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -110,6 +110,8 @@ ChouetteIhm::Application.routes.draw do
member do
get 'edit_boarding_alighting'
put 'save_boarding_alighting'
+ get 'duplicate'
+ post 'duplicate'
end
resource :journey_patterns_collection, :only => [:show, :update]
resources :journey_patterns do
diff --git a/spec/routing/routes_routing_spec.rb b/spec/routing/routes_routing_spec.rb
new file mode 100644
index 000000000..ca2d3ade9
--- /dev/null
+++ b/spec/routing/routes_routing_spec.rb
@@ -0,0 +1,11 @@
+RSpec.describe "routes for Routes", type: :routing do
+ it "routes to /referentials/:id/lines/:id/routes/:id/duplicate" do
+ expect(
+ get: '/referentials/:referential_id/lines/:line_id/routes/:id/duplicate'
+ ).to be_routable
+
+ expect(
+ post: '/referentials/:referential_id/lines/:line_id/routes/:id/duplicate'
+ ).to be_routable
+ end
+end