Sha256: eb3eaed184f499e24c3e4d79ae378dc71c0f27d24d9bb63569db5617af9dfa6c

Contents?: true

Size: 1.62 KB

Versions: 46

Compression:

Stored size: 1.62 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

  let!(:user) { create :user, first_name: 'John', last_name: 'Doe', uid: 'johndoe@test.com' }

  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('Chapters')
    expect(page).to_not have_text('Sign in')
    expect(page).to have_text('Sign Out')
  end

  scenario 'can login and keeps session', :navigation_error 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('C1')
  end

  scenario 'can logout', :element_not_interactable_error do
    visit '/'

    click_on 'Sign in'

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

    expect(page).to have_text('Chapters')

    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('My profile')
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
mumuki-laboratory-9.23.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.22.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.21.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.20.1 spec/features/login_flow_spec.rb
mumuki-laboratory-9.20.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.19.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.18.1 spec/features/login_flow_spec.rb
mumuki-laboratory-9.18.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.17.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.16.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.15.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.14.1 spec/features/login_flow_spec.rb
mumuki-laboratory-9.14.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.13.2 spec/features/login_flow_spec.rb
mumuki-laboratory-9.13.1 spec/features/login_flow_spec.rb
mumuki-laboratory-9.13.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.12.1 spec/features/login_flow_spec.rb
mumuki-laboratory-9.12.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.11.0 spec/features/login_flow_spec.rb
mumuki-laboratory-9.10.0 spec/features/login_flow_spec.rb