Sha256: d2fec93375f8bd0445d4e19fc64bc20465df337e71601e543b733dfc3e17a9c5

Contents?: true

Size: 1.56 KB

Versions: 53

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'

feature 'Login Flow', organization_workspace: :test do
  let!(:chapter) do
    create(:chapter, name: 'C1', lessons: [
      create(:lesson, language: create(:language), name: 'awesomeRubyGuide', description: 'rubist baz guide', exercises: [
        create(:exercise)
      ])
    ])
  end

  before { reindex_current_organization! }

  scenario 'can login' do
    visit '/'

    click_on 'Sign in'

    expect(page).to have_text('Start Practicing!')
    expect(page).to have_text('Content')
    expect(page).to have_text('Chapter')
    expect(page).to_not have_text('Sign in')
    expect(page).to have_text('Sign Out')
  end

  scenario 'can login and keeps session' do
    visit '/'

    click_on 'Sign in'

    visit '/'

    expect(page).to_not have_text('Sign in')
    expect(page).to have_text('Sign Out')
  end

  scenario 'can login in non root' do
    visit "/chapters/#{chapter.id}"

    click_on 'Sign in'

    expect(page).to_not have_text('Sign in')
    expect(page).to have_text('Sign Out')
    expect(page).to have_text('awesomeRubyGuide')
  end

  scenario 'can logout' do
    visit '/'

    click_on 'Sign in'

    expect(page).to have_text('Sign Out')
    click_on 'Sign Out'

    expect(page).to have_text('Content')
    expect(page).to have_text('Chapter')

    expect(page).to have_text('Sign in')
    expect(page).to_not have_text('Sign out')
  end

  scenario 'user can be prompted for login' do
    visit '/user'

    expect(page).to_not have_text('Sign in')
    expect(page).to have_text('Sign Out')
    expect(page).to have_text('Profile')
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
mumuki-laboratory-6.7.7 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.6 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.5 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.4 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.3 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.2 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.1 spec/features/login_flow_spec.rb
mumuki-laboratory-6.7.0 spec/features/login_flow_spec.rb
mumuki-laboratory-6.6.1 spec/features/login_flow_spec.rb
mumuki-laboratory-6.6.0 spec/features/login_flow_spec.rb
mumuki-laboratory-6.5.1 spec/features/login_flow_spec.rb
mumuki-laboratory-6.5.0 spec/features/login_flow_spec.rb
mumuki-laboratory-6.4.2 spec/features/login_flow_spec.rb
mumuki-laboratory-6.4.1 spec/features/login_flow_spec.rb
mumuki-laboratory-6.4.0 spec/features/login_flow_spec.rb
mumuki-laboratory-6.2.0 spec/features/login_flow_spec.rb
mumuki-laboratory-6.1.5 spec/features/login_flow_spec.rb
mumuki-laboratory-6.0.4 spec/features/login_flow_spec.rb
mumuki-laboratory-6.1.4 spec/features/login_flow_spec.rb
mumuki-laboratory-6.1.3 spec/features/login_flow_spec.rb