Sha256: 5607e541bddd91dafc8fc945e4523e0184339a36ab294dd74cdb8e3055027cb2

Contents?: true

Size: 1.27 KB

Versions: 8

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe 'Roles Admin', type: :feature, js: true do
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:exhibit_admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
  before do
    login_as exhibit_admin

    visit spotlight.exhibit_dashboard_path(exhibit)
    click_link 'Users'
  end

  it 'informs the admin that a user they are trying to add does not yet exist' do
    expect(page).to have_css('.help-block[data-behavior="no-user-note"]', visible: false)
    expect(page).not_to have_css('input[disabled]')

    click_link 'Add a new user'
    fill_in 'User key', with: 'user@example.com'

    expect(page).to have_css('.help-block[data-behavior="no-user-note"]', visible: true)
    expect(page).to have_link('invite', visible: true)
    expect(page).to have_css('input[disabled]')
  end

  it 'persists invited users to the exhibits user list' do
    expect(page).not_to have_css('.label-warning pending-label', text: 'pending', visible: true)

    click_link 'Add a new user'
    fill_in 'User key', with: 'user@example.com'
    click_link 'invite'

    within('tr.invite-pending') do
      expect(page).to have_css('td', text: 'user@example.com')
      expect(page).to have_css('.label-warning.pending-label', text: 'pending', visible: true)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight-spotlight-0.16.0 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.15.0 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.14.2 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.14.1 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.14.0 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.13.0 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.12.1 spec/features/javascript/roles_admin_spec.rb
blacklight-spotlight-0.12.0 spec/features/javascript/roles_admin_spec.rb