aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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