Sha256: 5cafd21e43722d15c2c4731da83273480af82e29887eed8284376a87b0ee2800

Contents?: true

Size: 564 Bytes

Versions: 12

Compression:

Stored size: 564 Bytes

Contents

module AuthMacros

  def log_in(attributes = {})
    @_current_user = FactoryGirl.create(:user, attributes)
    visit lines.login_path
    fill_in "Email", with: @_current_user.email
    fill_in "Password", with: @_current_user.password
    click_button "Login"
    page.should have_content "Logged in"
  end

  def authorize(attributes = {})
    @current_user = FactoryGirl.create(:user, attributes)
    controller.stub(:current_user).and_return(@current_user)
    controller.stub(:authorize).and_return(true)
  end

  def current_user
    @current_user
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lines-engine-0.1.14 spec/support/auth_macros.rb
lines-engine-0.1.13 spec/support/auth_macros.rb
lines-engine-0.1.12 spec/support/auth_macros.rb
lines-engine-0.1.11 spec/support/auth_macros.rb
lines-engine-0.1.10 spec/support/auth_macros.rb
lines-engine-0.1.9 spec/support/auth_macros.rb
lines-engine-0.1.8 spec/support/auth_macros.rb
lines-engine-0.1.7 spec/support/auth_macros.rb
lines-engine-0.1.6 spec/support/auth_macros.rb
lines-engine-0.1.5 spec/support/auth_macros.rb
lines-engine-0.1.4 spec/support/auth_macros.rb
lines-engine-0.1.3 spec/support/auth_macros.rb