Skip to content

Commit fc64a26

Browse files
committed
beef up be_routable feature
1 parent b9dc2b8 commit fc64a26

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

Diff for: features/routing_specs/be_routable_matcher.feature

+46-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,37 @@ Feature: be_routable matcher
33
The be_routable matcher is intended for use with should_not to specify
44
that a given route should_not be_routable.
55

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)
737
Given a file named "spec/routing/widgets_routing_spec.rb" with:
838
"""
939
require "spec_helper"
@@ -17,3 +47,18 @@ Feature: be_routable matcher
1747

1848
When I run "rspec spec/routing/widgets_routing_spec.rb"
1949
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

Comments
 (0)