-
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
1 parent
0f4bac6
commit 15990b4
Showing
5 changed files
with
72 additions
and
6 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
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,21 @@ | ||
Feature: Resource Publish | ||
Background: | ||
Given an administrator user is logged in | ||
And a Resource has been created | ||
Scenario: Publish the Resource record from toolbar | ||
Given the Resource is opened in edit mode | ||
When the user clicks on 'Publish All' | ||
And the user clicks on 'Publish All' in the modal | ||
Then the 'Resource' published message is displayed | ||
And the 'View Published' button is displayed | ||
Scenario: Publish the Resource record from the Publish checkbox in the Basic Information section | ||
Given the Resource is opened in edit mode | ||
When the user checks 'Publish' | ||
And the user clicks on 'Save' | ||
Then the 'Resource' updated message is displayed | ||
And the 'View Published' button is displayed | ||
Scenario: View a published Resource Record in the public interface | ||
Given the Resource is opened in edit mode | ||
And the Resource is published | ||
When the user clicks on 'View Published' | ||
Then the Resource opens on a new tab in the public interface |
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
31 changes: 31 additions & 0 deletions
31
staff_features/resources/step_definitions/resource_shared.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,31 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'the Resource is opened in edit mode' do | ||
visit "#{STAFF_URL}/resources/#{@resource_id}/edit" | ||
wait_for_ajax | ||
end | ||
|
||
Given 'the Resource is published' do | ||
expect(find('#resource_publish_').checked?).to eq true | ||
end | ||
|
||
Given 'the {string} button is displayed' do |button_text| | ||
expect(page).to have_css('a', text: button_text) | ||
end | ||
|
||
Then 'the Resource opens on a new tab in the public interface' do | ||
expect(page.windows.size).to eq 2 | ||
switch_to_window(page.windows[1]) | ||
|
||
tries = 0 | ||
|
||
while current_url == 'about:blank' | ||
break if tries == 3 | ||
|
||
tries += 1 | ||
sleep 1 | ||
end | ||
|
||
expect(current_url).to eq "#{PUBLIC_URL}/repositories/#{@repository_id}/resources/#{@resource_id}" | ||
expect(page).to have_text "Resource #{@uuid}" | ||
end |
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