Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Created November 29, 2011 22:38
Show Gist options
  • Select an option

  • Save daniel-nelson/1406927 to your computer and use it in GitHub Desktop.

Select an option

Save daniel-nelson/1406927 to your computer and use it in GitHub Desktop.
def i_sign_in(user, password='secret')
if user.is_a?(User)
visit new_user_session_path
within('#user_new') do
fill_in('Email', :with => user.email)
fill_in('Password', :with => password)
click_button('Sign in')
end
elsif user.is_a?(Admin)
visit new_admin_session_path
within('#admin_new') do
fill_in('Email', :with => user.email)
fill_in('Password', :with => password)
click_button('Sign in')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment