Skip to content

Instantly share code, notes, and snippets.

@vladvinnikov
Created January 22, 2012 22:10
Show Gist options
  • Save vladvinnikov/1659093 to your computer and use it in GitHub Desktop.
Save vladvinnikov/1659093 to your computer and use it in GitHub Desktop.
Authlogic rspec webrat
require "authlogic/test_case"
def execute_login
activate_authlogic
@user = Factory.create(:user, :confirmation_ok => true)
@user_session = UserSession.create(@user)
end
before(:all) do
09.
activate_authlogic
10.
@user = User.create!(:name => "foo bar", :email => "[email protected]", :password => "foobar", :password_confirmation => "foobar")
11.
visit admin_posts_url
12.
fill_in "user_session_email",:with => "[email protected]"
13.
fill_in "user_session_password",:with => "foobar"
14.
click_button "Enter"
15.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment