@@ -3,7 +3,37 @@ Feature: be_routable matcher
3
3
The be_routable matcher is intended for use with should_not to specify
4
4
that a given route should_not be_routable.
5
5
6
- Scenario : with a route that is not routable
6
+ Scenario : specify routeable route should be routable (passes)
7
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
8
+ """
9
+ require "spec_helper"
10
+
11
+ describe WidgetsController do
12
+ it "does not route to widgets/foo/bar" do
13
+ { :get => "/widgets" }.should be_routable
14
+ end
15
+ end
16
+ """
17
+
18
+ When I run "rspec spec/routing/widgets_routing_spec.rb"
19
+ Then I should see "1 example, 0 failures"
20
+
21
+ Scenario : specify routeable route should not be routable (fails)
22
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
23
+ """
24
+ require "spec_helper"
25
+
26
+ describe WidgetsController do
27
+ it "does not route to widgets/foo/bar" do
28
+ { :get => "/widgets" }.should_not be_routable
29
+ end
30
+ end
31
+ """
32
+
33
+ When I run "rspec spec/routing/widgets_routing_spec.rb"
34
+ Then I should see "1 example, 1 failure"
35
+
36
+ Scenario : specify non-routeable route should not be routable (passes)
7
37
Given a file named "spec/routing/widgets_routing_spec.rb" with:
8
38
"""
9
39
require "spec_helper"
@@ -17,3 +47,18 @@ Feature: be_routable matcher
17
47
18
48
When I run "rspec spec/routing/widgets_routing_spec.rb"
19
49
Then I should see "1 example, 0 failures"
50
+
51
+ Scenario : specify non-routeable route should be routable (fails)
52
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
53
+ """
54
+ require "spec_helper"
55
+
56
+ describe WidgetsController do
57
+ it "does not route to widgets/foo/bar" do
58
+ { :get => "/widgets/foo/bar" }.should be_routable
59
+ end
60
+ end
61
+ """
62
+
63
+ When I run "rspec spec/routing/widgets_routing_spec.rb"
64
+ Then I should see "1 example, 1 failure"
0 commit comments