Working user order flow spec

This commit is contained in:
2013-12-02 07:38:02 +01:00
parent 7b9b784ef9
commit afb30556bd
15 changed files with 161 additions and 7 deletions
+15
View File
@@ -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