-
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 #5 from archivesspace/gherkin-scenarios-for-digita…
…l-object-management Create digital objects
- Loading branch information
Showing
5 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
staff-features/digital-objects/digital_object_create.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,16 @@ | ||
Feature: Create Digital Object | ||
Background: | ||
Given I am logged in as an admin user | ||
Scenario: Digital object is successfully created | ||
Given I am on the New Digital Object page | ||
When I fill in Title with a unique id | ||
And I fill in Identifier with a unique id | ||
And I click on Save | ||
Then a digital object is created | ||
Scenario: Digital object fails to be created because required fields are missing | ||
Given I am on the New Digital Object page | ||
When I click on Save | ||
Then the following error messages are displayed: | ||
| Title - Property is required but was missing | | ||
| Identifier - Property is required but was missing | | ||
And a digital object is not created |
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,28 @@ | ||
# frozen_string_literal: true | ||
|
||
Given('I am on the New Digital Object page') do | ||
@uuid = SecureRandom.uuid | ||
|
||
visit "#{STAFF_URL}/digital_objects/new" | ||
end | ||
|
||
When('I fill in Title with a unique id') do | ||
fill_in 'Title', with: "Digital Object Title #{@uuid}" | ||
end | ||
|
||
When('I fill in Identifier with a unique id') do | ||
fill_in 'Identifier', with: @uuid | ||
end | ||
|
||
Then('a digital object is created') do | ||
expect(find('h2').text).to eq "Digital Object Title #{@uuid} Digital Object" | ||
expect(find('.alert.alert-success.with-hide-alert').text).to eq "Digital Object Digital Object Title #{@uuid} Created" | ||
|
||
expect_record_to_be_in_search_results(@uuid) | ||
end | ||
|
||
Then ('a digital object is not created') do | ||
expect(find('h2').text).to eq 'New Digital Object Digital Object' | ||
|
||
expect_record_to_not_be_in_search_results(@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
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