Sha256: 4c315135173e838799802e1ca1795c8c9e0d92c3869a971789853793e8af7fa7

Contents?: true

Size: 1.11 KB

Versions: 20

Compression:

Stored size: 1.11 KB

Contents

require 'rails_helper'

RSpec.describe 'Shelves', type: :system do
  include Devise::Test::IntegrationHelpers
  fixtures :all

  describe 'When logged in as Administrator' do
    before do
      sign_in users(:admin)
    end

    it 'should show shelf config' do
      visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
      expect(page).to have_content '新規作成'
    end
  end

  describe 'When logged in as Librarian' do
    before do
      sign_in users(:librarian1)
    end

    it 'should not show shelf config' do
      visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
      expect(page).not_to have_content '新規作成'
    end
  end

  describe 'When logged in as User' do
    before do
      sign_in users(:user1)
    end

    it 'should not show shelf config' do
      visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
      expect(page).not_to have_content '新規作成'
    end
  end

  describe 'When not logged in' do
    it 'should not show shelf config' do
      visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
      expect(page).not_to have_content '新規作成'
    end
  end
end

Version data entries

20 entries across 17 versions & 1 rubygems

Version Path
enju_library-0.3.11 spec/system/shelves_spec.rb
enju_library-0.3.10 spec/system/shelves_spec.rb
enju_library-0.3.9 spec/system/shelves_spec.rb
enju_library-0.3.8 spec/system/shelves_spec.rb
enju_library-0.3.8.rc.2 spec/system/shelves_spec.rb
enju_library-0.3.8.rc.1 spec/system/shelves_spec.rb
enju_library-0.4.0.rc.1 spec/system/shelves_spec.rb
enju_library-0.3.7 spec/system/shelves_spec.rb
enju_library-0.3.6 spec/system/shelves_spec.rb
enju_library-0.4.0.beta.4 spec/system/shelves_spec.rb
enju_library-0.4.0.beta.3 spec/system/shelves_spec.rb
enju_library-0.4.0.beta.2 spec/system/shelves_spec.rb
enju_library-0.4.0.beta.1 spec/system/shelves_spec.rb
enju_library-0.3.5 spec/shelves_spec.rb
enju_library-0.3.5 spec/system/shelves_spec.rb
enju_library-0.3.4 spec/system/shelves_spec.rb
enju_library-0.3.3 spec/shelves_spec.rb
enju_library-0.3.3 spec/system/shelves_spec.rb
enju_library-0.3.2 spec/system/shelves_spec.rb
enju_library-0.3.2 spec/shelves_spec.rb