Sha256: 6f8e4092d5213e777d5c14403b908a96308a89bbe11baa365b4df30b06623609

Contents?: true

Size: 1.12 KB

Versions: 13

Compression:

Stored size: 1.12 KB

Contents

require 'rails_helper'

RSpec.describe 'Libraries', 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 library config' do
      visit library_path(libraries(:library_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 library config' do
      visit library_path(libraries(:library_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 library config' do
      visit library_path(libraries(:library_00002).id, locale: :ja)
      expect(page).not_to have_content '設定'
    end
  end

  describe 'When not logged in' do
    it 'should not show library config' do
      visit library_path(libraries(:library_00002).id, locale: :ja)
      expect(page).not_to have_content '設定'
    end
  end
end

Version data entries

13 entries across 10 versions & 1 rubygems

Version Path
enju_library-0.3.7 spec/system/libraries_spec.rb
enju_library-0.3.6 spec/system/libraries_spec.rb
enju_library-0.4.0.beta.4 spec/system/libraries_spec.rb
enju_library-0.4.0.beta.3 spec/system/libraries_spec.rb
enju_library-0.4.0.beta.2 spec/system/libraries_spec.rb
enju_library-0.4.0.beta.1 spec/system/libraries_spec.rb
enju_library-0.3.5 spec/system/libraries_spec.rb
enju_library-0.3.5 spec/libraries_spec.rb
enju_library-0.3.4 spec/system/libraries_spec.rb
enju_library-0.3.3 spec/system/libraries_spec.rb
enju_library-0.3.3 spec/libraries_spec.rb
enju_library-0.3.2 spec/libraries_spec.rb
enju_library-0.3.2 spec/system/libraries_spec.rb