Working user order flow spec
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
module SpecRouteHelpers
|
||||
# allows tests like:
|
||||
# route_should_be 'agama_groups#index'
|
||||
def route_should_be(route_def)
|
||||
route_hash = case route_def
|
||||
when String
|
||||
controller_name, action_name = route_def.split('#')
|
||||
#action_name = 'index' unless action_name.present?
|
||||
{controller: controller_name, action: action_name}
|
||||
else
|
||||
route_def
|
||||
end
|
||||
Rails.application.routes.recognize_path(page.current_path).should include route_hash
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user