-
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.
Merge pull request #4 from archivesspace/gherkin-scenarios-for-resour…
…ces-management Resources
- Loading branch information
Showing
4 changed files
with
148 additions
and
23 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,23 @@ | ||
Feature: Update Resource Basic Information | ||
Background: | ||
Given I am logged in as an admin user | ||
Given a resource has been created | ||
Scenario: Successfully update resource basic information | ||
Given I am on the resource edit page | ||
When I select "Records" from "Resource Type" | ||
When I check Publish? | ||
When I check Restrictions Apply? | ||
When I fill in Repository Processing Note with "Repository Processing Note" | ||
When I click on "Save Resource" | ||
Then the resource is successfully updated | ||
Then Resource Type has value Records | ||
Then Publish? is checked | ||
Then Restrictions Apply? is checked | ||
Then Repository Processing Note has value "Repository Processing Note" | ||
Scenario: Revert changes | ||
Given I am on the resource edit page | ||
When I change the resource Title | ||
When I change the resource Identifier | ||
When I click on "Revert Changes" | ||
Then the resource Title does not change | ||
Then the resource Identifier does not change |
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,67 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'a resource has been created' do | ||
@uuid = SecureRandom.uuid | ||
|
||
visit "#{STAFF_URL}/resources/new" | ||
|
||
create_resource(@uuid) | ||
end | ||
|
||
Given 'I am on the resource edit page' do | ||
search(@uuid) | ||
|
||
click_on 'Edit' | ||
end | ||
|
||
When 'I check Publish?' do | ||
find('#resource_publish_').check | ||
end | ||
|
||
When 'I check Restrictions Apply?' do | ||
find('#resource_restrictions_').check | ||
end | ||
|
||
When 'I fill in Repository Processing Note with {string}' do |value| | ||
fill_in 'Repository Processing Note', with: value | ||
end | ||
|
||
When 'I change the resource Title' do | ||
fill_in 'resource_title_', with: 'Resource title chagned' | ||
end | ||
|
||
When 'I change the resource Identifier' do | ||
fill_in 'resource_id_0_', with: 'Resource identifier chagned' | ||
end | ||
|
||
Then 'the resource is successfully updated' do | ||
element = find('.alert.alert-success.with-hide-alert') | ||
expect(element.text).to eq "Resource Resource #{@uuid} updated" | ||
end | ||
|
||
Then 'Resource Type has value Records' do | ||
# search(@uuid) | ||
# click_on 'Edit' | ||
element = find('#resource_resource_type_') | ||
expect(element.value).to eq 'records' | ||
end | ||
|
||
Then 'Publish? is checked' do | ||
expect(find('#resource_publish_').check.checked?).to eq true | ||
end | ||
|
||
Then 'Restrictions Apply? is checked' do | ||
expect(find('#resource_restrictions_').check.checked?).to eq true | ||
end | ||
|
||
Then 'Repository Processing Note has value {string}' do |value| | ||
expect(find('#resource_repository_processing_note_').value).to eq value | ||
end | ||
|
||
Then('the resource Title does not change') do | ||
expect(find('#resource_title_').value).to eq "Resource #{@uuid}" | ||
end | ||
|
||
Then('the resource Identifier does not change') do | ||
expect(find('#resource_id_0_').value).to eq "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