-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add acceptance test for admin locking an event.
- Loading branch information
1 parent
adcc552
commit 9c88ca7
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|