Displaying 2 results from an estimated 2 matches for "current_url".
2011 Mar 21
1
Getting user session object in cucumber
...l_in(''Email'', :with=>"john_rennie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org")
fill_in(''Password'', :with=>"neova123")
click_button("Login")
end
Then /^user should be on project (.+)$/ do |page_name|
current_path = URI.parse(current_url).path
if current_path.respond_to? :should
current_path.should == path_to(page_name)
else
assert_equal path_to(page_name), current_path
end
end
When /^user create a project with name "([^"]*)"$/ do |project_name|
visit new_project_path
fill_in("project_name&quo...
2006 Apr 23
2
Check if current route == some route
...ed in visitors to the "join" page if they''re not on
that page already.
The code I came up with is a bit ugly:
redirect_to join_url unless (@logged_in or action_name == "join")
I''m pretty sure there is some nice way of doing this, along the lines of
... current_url == join_url
but I can''t seem to find it on Google, nor does #rubyonrails know.
Anyone?
Another way to solve this would be :exclude on the filter, but can you
exclude a specific action in a specific controller, for an
ApplicationController filter?
--
Henrik N
--
Posted via http://ww...