-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
staff_features/digital_objects/digital_object_suppress.feature
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,17 @@ | ||
Feature: Digital Object Suppress | ||
Background: | ||
Given an administrator user is logged in | ||
And a Digital Object has been created | ||
And the Digital Object is opened in edit mode | ||
Scenario: Digital Object is suppressed | ||
Given the Digital Object is not suppressed | ||
When the user clicks on 'Suppress' | ||
And the user clicks on 'Suppress' in the modal | ||
Then the Digital Object now is suppressed | ||
And the Digital Object cannot be accessed by archivists | ||
Scenario: Digital Object is unsuppressed | ||
Given the Digital Object is suppressed | ||
When the user clicks on 'Unsuppress' | ||
And the user clicks on 'Unsuppress' in the modal | ||
Then the Digital Object now is not suppressed | ||
And the Digital Object can be accessed by archivists |
54 changes: 54 additions & 0 deletions
54
staff_features/digital_objects/step_definitions/digital_object_suppress.rb
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,54 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'the Digital Object is not suppressed' do | ||
expect(page).to have_css('button', text: 'Suppress') | ||
end | ||
|
||
Given 'the Digital Object is suppressed' do | ||
expect(page).to have_css('button', text: 'Suppress') | ||
|
||
click_on 'Suppress' | ||
within '.modal-content' do | ||
click_on 'Suppress' | ||
end | ||
|
||
expect(current_url).to include "digital_objects/#{@digital_object_id}" | ||
expect(page).to have_text "Digital Object Digital Object Title #{@uuid} suppressed" | ||
expect(page).to have_text 'Digital Object is suppressed and cannot be edited' | ||
end | ||
|
||
Then 'the Digital Object now is suppressed' do | ||
expect(current_url).to include "digital_objects/#{@digital_object_id}" | ||
expect(page).to have_text "Digital Object Digital Object Title #{@uuid} suppressed" | ||
expect(page).to have_text 'Digital Object is suppressed and cannot be edited' | ||
end | ||
|
||
Then 'the Digital Object now is not suppressed' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
wait_for_ajax | ||
|
||
expect(current_url).to include "/digital_objects/#{@digital_object_id}/edit" | ||
|
||
expect(page).to have_css('button', text: 'Suppress') | ||
end | ||
|
||
Then 'the Digital Object cannot be accessed by archivists' do | ||
visit "#{STAFF_URL}/logout" | ||
|
||
login_archivist | ||
|
||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}" | ||
|
||
expect(page).to have_text 'Record Not Found' | ||
expect(page).to have_text "The record you've tried to access may no longer exist or you may not have permission to view it." | ||
end | ||
|
||
Then 'the Digital Object can be accessed by archivists' do | ||
visit "#{STAFF_URL}/logout" | ||
|
||
login_archivist | ||
|
||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
expect(current_url).to include "/digital_objects/#{@digital_object_id}/edit" | ||
end |