aboutsummaryrefslogtreecommitdiffstats
path: root/spec/routing/routes_routing_spec.rb
diff options
context:
space:
mode:
authorRobert2017-08-08 12:19:49 +0200
committerRobert2017-08-11 10:03:46 +0200
commite5e44b82fcda9382b5ef5b7cbf0c1ef81fda0404 (patch)
tree284088e818eb094bc2b06dc8ccd106400a98a43d /spec/routing/routes_routing_spec.rb
parent51b73758486294862c47707d9b85e7cefeb0242a (diff)
downloadchouette-core-e5e44b82fcda9382b5ef5b7cbf0c1ef81fda0404.tar.bz2
Refs: #4189@0.5h; routing specs updated to specify desired behavior exactly
Diffstat (limited to 'spec/routing/routes_routing_spec.rb')
-rw-r--r--spec/routing/routes_routing_spec.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/spec/routing/routes_routing_spec.rb b/spec/routing/routes_routing_spec.rb
index ca2d3ade9..4635603d4 100644
--- a/spec/routing/routes_routing_spec.rb
+++ b/spec/routing/routes_routing_spec.rb
@@ -1,11 +1,18 @@
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
+ context "routes /referentials/:id/lines/:id/routes/:id/duplicate" do
- expect(
- post: '/referentials/:referential_id/lines/:line_id/routes/:id/duplicate'
- ).to be_routable
+ let( :controller ){ {controller: 'routes', referential_id: ':referential_id', line_id: ':line_id', id: ':id'} }
+
+ it 'with method get to #duplicate' do
+ expect(
+ get: '/referentials/:referential_id/lines/:line_id/routes/:id/duplicate'
+ ).to route_to controller.merge(action: 'duplicate')
+ end
+
+ it 'with method post to #post_duplicate' do
+ expect(
+ post: '/referentials/:referential_id/lines/:line_id/routes/:id/duplicate'
+ ).to route_to controller.merge(action: 'post_duplicate')
+ end
end
end