Skip to content

Commit c4a6209

Browse files
authored
Digital Object Publish (#65)
1 parent b1102e8 commit c4a6209

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Feature: Digital Object Publish
2+
Background:
3+
Given an administrator user is logged in
4+
And a Digital Object has been created
5+
Scenario: Publish the Digital Object from toolbar
6+
Given the Digital Object is opened in edit mode
7+
When the user clicks on 'Publish All'
8+
And the user clicks on 'Publish All' in the modal
9+
Then the 'Digital Object' published message is displayed
10+
And the 'View Published' button is displayed
11+
Scenario: Publish the Digital Object from the Publish checkbox in the Basic Information section
12+
Given the Digital Object is opened in edit mode
13+
When the user checks 'Publish'
14+
And the user clicks on 'Save'
15+
Then the 'Digital Object' updated message is displayed
16+
And the 'View Published' button is displayed
17+
Scenario: View a published Digital Object in the public interface
18+
Given the Digital Object is opened in edit mode
19+
And the Digital Object is published
20+
When the user clicks on 'View Published'
21+
Then the Digital Object opens on a new tab in the public interface

staff_features/digital_objects/step_definitions/digital_object_shared.rb

+22
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
click_on 'Add Date'
1010
select 'Single', from: 'digital_object_dates__0__date_type_'
1111
fill_in 'digital_object_dates__0__begin_', with: '2000-01-01'
12+
check 'Publish'
1213

1314
@digital_object_number_of_file_versions = 0
1415

@@ -135,3 +136,24 @@
135136

136137
expect(subrecords.length).to eq @digital_object_number_of_file_versions - 1
137138
end
139+
140+
Given 'the Digital Object is published' do
141+
expect(find('#digital_object_publish_').checked?).to eq true
142+
end
143+
144+
Then 'the Digital Object opens on a new tab in the public interface' do
145+
expect(page.windows.size).to eq 2
146+
switch_to_window(page.windows[1])
147+
148+
tries = 0
149+
150+
while current_url == 'about:blank'
151+
break if tries == 3
152+
153+
tries += 1
154+
sleep 1
155+
end
156+
157+
expect(current_url).to eq "#{PUBLIC_URL}/repositories/#{@repository_id}/digital_objects/#{@digital_object_id}"
158+
expect(page).to have_text "Digital Object Title #{@uuid}"
159+
end

0 commit comments

Comments
 (0)