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-6.0.5 spec/requests/login_spec.rb
symphonia-6.0.2 spec/requests/login_spec.rb
symphonia-6.0.1 spec/requests/login_spec.rb
symphonia-6.0.0 spec/requests/login_spec.rb
symphonia-5.0.6 spec/requests/login_spec.rb
symphonia-5.0.5 spec/requests/login_spec.rb
symphonia-5.0.4 spec/requests/login_spec.rb
symphonia-5.0.3 spec/requests/login_spec.rb
symphonia-5.0.0 spec/requests/login_spec.rb
symphonia-4.2.0 spec/requests/login_spec.rb
symphonia-4.1.3 spec/requests/login_spec.rb
symphonia-4.1.2 spec/requests/login_spec.rb
symphonia-4.1.1 spec/requests/login_spec.rb
symphonia-4.1.0 spec/requests/login_spec.rb
symphonia-4.0.1 spec/requests/login_spec.rb
symphonia-4.0.0 spec/requests/login_spec.rb
symphonia-3.4.0 spec/requests/login_spec.rb
symphonia-3.3.4 spec/requests/login_spec.rb
symphonia-3.3.3 spec/requests/login_spec.rb
symphonia-3.3.2 spec/requests/login_spec.rb