Skip to content

Commit

Permalink
add acceptance test for admin locking an event.
Browse files Browse the repository at this point in the history
  • Loading branch information
botandrose-machine committed Feb 14, 2015
1 parent adcc552 commit 9c88ca7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/features/admin_lock_event_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'rails_helper'

feature 'Event locking' do
background do
create :venue, title: 'Empire State Building'
create :event, title: 'Ruby Newbies'

page.driver.basic_authorize SECRETS.admin_username, SECRETS.admin_password
end

scenario 'Admin signs in and locks an event to prevent it from being modified' do
visit '/admin'
click_on 'Lock events'

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
end

0 comments on commit 9c88ca7

Please sign in to comment.