Sha256: 045c347bb034a647d18351dac5e21831fe45551de7def704dad9758133aa24d5

Contents?: true

Size: 612 Bytes

Versions: 30

Compression:

Stored size: 612 Bytes

Contents

module AuthMacros

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

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

  def current_lines_user
    @current_lines_user
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
lines-engine-0.6.2 spec/support/auth_macros.rb
lines-engine-0.6.1 spec/support/auth_macros.rb
lines-engine-0.6 spec/support/auth_macros.rb
lines-engine-0.5 spec/support/auth_macros.rb
lines-engine-0.4.6.4 spec/support/auth_macros.rb
lines-engine-0.4.6.3 spec/support/auth_macros.rb
lines-engine-0.4.6.1 spec/support/auth_macros.rb
lines-engine-0.4.6 spec/support/auth_macros.rb
lines-engine-0.4.5 spec/support/auth_macros.rb
lines-engine-0.4.4 spec/support/auth_macros.rb
lines-engine-0.4.2 spec/support/auth_macros.rb
lines-engine-0.4.1 spec/support/auth_macros.rb
lines-engine-0.4 spec/support/auth_macros.rb
lines-engine-0.3.3.2 spec/support/auth_macros.rb
lines-engine-0.3.3.1 spec/support/auth_macros.rb
lines-engine-0.3.3 spec/support/auth_macros.rb
lines-engine-0.3.2 spec/support/auth_macros.rb
lines-engine-0.3.1 spec/support/auth_macros.rb
lines-engine-0.3 spec/support/auth_macros.rb
lines-engine-0.2 spec/support/auth_macros.rb