Sha256: acc6839dc67354edc547fc6ea9c38cb792c6fb40667339213cb21fa2c5a85209

Contents?: true

Size: 1.66 KB

Versions: 63

Compression:

Stored size: 1.66 KB

Contents

require 'spec_helper'

feature 'disable user flow', organization_workspace: :test do
  let!(:current_organization) { Organization.current }
  let(:user) { create(:user) }

  let!(:chapter) {
    create(:chapter, lessons: [
        create(:lesson, guide: create(:guide))]) }

  let(:book) { current_organization.book }

  before { reindex_current_organization! }

  before { set_current_user! user }

  scenario 'enabled organization' do
    visit '/'

    expect(page_body).to have_text(current_organization.book.name)
    expect(user.reload.last_organization).to eq current_organization
  end

  context 'unprepared organization' do

    before { current_organization.update! in_preparation_until: 2.minutes.since }

    scenario 'visit /' do
      visit '/'

      expect(page_body).to_not have_text(current_organization.book.name)
      expect(page_body).to have_text(I18n.t(:unprepared_organization_explanation))
    end

    scenario 'visit /user' do
      visit '/test/user'

      expect(page_body).to_not have_text(current_organization.book.name)
      expect(page_body).to have_text(I18n.t(:unprepared_organization_explanation))
    end

  end

  context 'disabled organization' do

    before { current_organization.update! disabled_from: 2.minutes.ago }

    scenario 'visit /' do
      visit '/'

      expect(page_body).to_not have_text(current_organization.book.name)
      expect(page_body).to have_text(I18n.t(:disabled_organization_explanation))
    end

    scenario 'visit /user' do
      visit '/test/user'

      expect(page_body).to_not have_text(current_organization.book.name)
      expect(page_body).to have_text(I18n.t(:disabled_organization_explanation))
    end

    end
end

Version data entries

63 entries across 63 versions & 1 rubygems

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