Sha256: 683d3c21e5355ac97e424346719470b62da760b3b2fdd48b3ba26d85100e483b

Contents?: true

Size: 1.26 KB

Versions: 11

Compression:

Stored size: 1.26 KB

Contents

require 'rails_helper'

feature 'Event locking' do
  background do
    create :venue, title: 'Empire State Building'
    create :event, title: 'Ruby Newbies', start_time: Time.zone.now
    create :event, title: 'Ruby Privateers', start_time: Time.zone.now, locked: true

    page.driver.basic_authorize Calagator.admin_username, Calagator.admin_password

    visit '/admin'
    click_on 'Lock events'
  end

  scenario 'Admin locks an event to prevent it from being modified' do
    within 'tr', text: 'Ruby Newbies' do
      click_on 'Lock'
    end

    expect(page).to have_content('Locked event Ruby Newbies')
    click_on 'Ruby Newbies'

    expect(page).to have_content('This event is currently locked and cannot be edited.')
    expect(page).to_not have_selector('a', text: 'edit')
    expect(page).to_not have_selector('a', text: 'delete')
  end

  scenario 'Admin unlocks a locked event' do
    within 'tr', text: 'Ruby Privateers' do
      click_on 'Unlock'
    end

    expect(page).to have_content('Unlocked event Ruby Privateers')
    click_on 'Ruby Privateers'

    expect(page).to_not have_content('This event is currently locked and cannot be edited.')
    expect(page).to have_selector('a', text: 'edit')
    expect(page).to have_selector('a', text: 'delete')
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
grokus-1.0.0.9 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.8 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.7 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.6 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.5 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.3 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.2 spec/features/admin_lock_event_spec.rb
grokus-1.0.0.1 spec/features/admin_lock_event_spec.rb
calagator-1.0.0.rc3 spec/features/admin_lock_event_spec.rb
calagator-1.0.0.rc2 spec/features/admin_lock_event_spec.rb
calagator-1.0.0.rc1 spec/features/admin_lock_event_spec.rb