Skip to content

Commit b605144

Browse files
authored
Digital Object Suppress (#70)
1 parent 3a20690 commit b605144

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Feature: Digital Object Suppress
2+
Background:
3+
Given an administrator user is logged in
4+
And a Digital Object has been created
5+
And the Digital Object is opened in edit mode
6+
Scenario: Digital Object is suppressed
7+
Given the Digital Object is not suppressed
8+
When the user clicks on 'Suppress'
9+
And the user clicks on 'Suppress' in the modal
10+
Then the Digital Object now is suppressed
11+
And the Digital Object cannot be accessed by archivists
12+
Scenario: Digital Object is unsuppressed
13+
Given the Digital Object is suppressed
14+
When the user clicks on 'Unsuppress'
15+
And the user clicks on 'Unsuppress' in the modal
16+
Then the Digital Object now is not suppressed
17+
And the Digital Object can be accessed by archivists
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# frozen_string_literal: true
2+
3+
Given 'the Digital Object is not suppressed' do
4+
expect(page).to have_css('button', text: 'Suppress')
5+
end
6+
7+
Given 'the Digital Object is suppressed' do
8+
expect(page).to have_css('button', text: 'Suppress')
9+
10+
click_on 'Suppress'
11+
within '.modal-content' do
12+
click_on 'Suppress'
13+
end
14+
15+
expect(current_url).to include "digital_objects/#{@digital_object_id}"
16+
expect(page).to have_text "Digital Object Digital Object Title #{@uuid} suppressed"
17+
expect(page).to have_text 'Digital Object is suppressed and cannot be edited'
18+
end
19+
20+
Then 'the Digital Object now is suppressed' do
21+
expect(current_url).to include "digital_objects/#{@digital_object_id}"
22+
expect(page).to have_text "Digital Object Digital Object Title #{@uuid} suppressed"
23+
expect(page).to have_text 'Digital Object is suppressed and cannot be edited'
24+
end
25+
26+
Then 'the Digital Object now is not suppressed' do
27+
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit"
28+
29+
wait_for_ajax
30+
31+
expect(current_url).to include "/digital_objects/#{@digital_object_id}/edit"
32+
33+
expect(page).to have_css('button', text: 'Suppress')
34+
end
35+
36+
Then 'the Digital Object cannot be accessed by archivists' do
37+
visit "#{STAFF_URL}/logout"
38+
39+
login_archivist
40+
41+
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}"
42+
43+
expect(page).to have_text 'Record Not Found'
44+
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."
45+
end
46+
47+
Then 'the Digital Object can be accessed by archivists' do
48+
visit "#{STAFF_URL}/logout"
49+
50+
login_archivist
51+
52+
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit"
53+
expect(current_url).to include "/digital_objects/#{@digital_object_id}/edit"
54+
end

0 commit comments

Comments
 (0)