Sha256: e002dc1f405c0e6f3cf06d88b54ed9d30795c81f1217277184d7ed5eabf5f514

Contents?: true

Size: 781 Bytes

Versions: 38

Compression:

Stored size: 781 Bytes

Contents

describe 'login' do

  let(:regular_user) { FactoryBot.create(:user, password: 'heslo123', password_confirmation: 'heslo123')}

  it 'login form' do
    get symphonia.login_path
    expect(response).to have_http_status(:success)
  end

  it 'login process' do
    expect(Symphonia::User.current).to be_a Symphonia::User::Anonymous
    post symphonia.user_sessions_path, params: { login_session: { login: regular_user.login, password: 'heslo123' }}
    expect(response).to have_http_status :redirect
    expect(Symphonia::User.current.id).to eq regular_user.id
  end

  context 'logged', logged: true do

    it '#logout' do
      expect(Symphonia::User.current).to be_a Symphonia::User
      delete symphonia.logout_path
      expect(response).to redirect_to '/'
    end
  end

end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
symphonia-3.3.0 spec/requests/login_spec.rb
symphonia-3.2.4 spec/requests/login_spec.rb
symphonia-3.2.3 spec/requests/login_spec.rb
symphonia-3.2.2 spec/requests/login_spec.rb
symphonia-3.2.1 spec/requests/login_spec.rb
symphonia-3.1.5 spec/requests/login_spec.rb
symphonia-3.1.4 spec/requests/login_spec.rb
symphonia-3.1.3 spec/requests/login_spec.rb
symphonia-3.1.2 spec/requests/login_spec.rb
symphonia-3.1.1 spec/requests/login_spec.rb
symphonia-3.1.0 spec/requests/login_spec.rb
symphonia-3.0.3 spec/requests/login_spec.rb
symphonia-3.0.2 spec/requests/login_spec.rb
symphonia-2.2.1 spec/requests/login_spec.rb
symphonia-3.0.1 spec/requests/login_spec.rb
symphonia-3.0.0 spec/requests/login_spec.rb
symphonia-2.1.8 spec/requests/login_spec.rb
symphonia-2.1.7 spec/requests/login_spec.rb