We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7483b26 commit 12ce292Copy full SHA for 12ce292
lib/rspec/rails/example/controller_example_group.rb
@@ -76,6 +76,22 @@ def self.name; "AnonymousController"; end
76
@orig_routes = nil
77
end
78
79
+
80
+ # Specifies the routeset that will be used for the example group. This
81
+ # is most useful when testing Rails engines.
82
+ #
83
+ # @example
84
85
+ # describe MyEngine::PostsController do
86
+ # routes { MyEngine::Engine.routes }
87
88
+ # # ...
89
+ # end
90
+ def routes(&blk)
91
+ before do
92
+ self.routes = blk.call
93
+ end
94
95
96
97
attr_reader :controller, :routes
0 commit comments