Sha256: 21df41682dcd8da91a5cf65c806ead51be0adc30dec64f316e8da47d5aa06b58

Contents?: true

Size: 829 Bytes

Versions: 21

Compression:

Stored size: 829 Bytes

Contents

require 'spec_helper'

feature 'user logs in' do
  scenario 'with valid email and password' do
    log_in({ email: 'valid@example.com', password: 'password' })

    expect(page).to have_content('Logged in')
  end

  scenario 'with invalid email' do
    @_current_lines_user = FactoryGirl.create(:user)
    visit lines.login_path
    fill_in "email", with: "invalid_email"
    fill_in "password", with: 'sekret1234'
    click_button "Login"
    page.should have_content('Email or password is invalid')
  end

  scenario 'with blank password' do
    @_current_lines_user = FactoryGirl.create(:user, email: 'valid@example.com')
    visit lines.login_path
    fill_in "email", with: "valid@example.com"
    fill_in "password", with: ''
    click_button "Login"
    page.should have_content('Email or password is invalid')
  end 

end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
lines-engine-0.9.0 spec/features/user_logs_in_spec.rb