Skip to content

Instantly share code, notes, and snippets.

@jamesgolick
Created July 12, 2009 20:31
Show Gist options
  • Save jamesgolick/145788 to your computer and use it in GitHub Desktop.
Save jamesgolick/145788 to your computer and use it in GitHub Desktop.
def new_session(as_user_with_nickname)
open_session do |s|
s.extend(Webrat::Matchers)
s.extend(Webrat::Methods)
unless as_user_with_nickname.nil?
s.visit login_url
s.fill_in "Nickname or Email", :with => as_user_with_nickname
s.fill_in "Password", :with => "swordfish"
s.click_button "Login to Fetlife"
end
yield(s)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment