-
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
e2a07ed
commit fe6d90c
Showing
5 changed files
with
38 additions
and
5 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
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
18 changes: 18 additions & 0 deletions
18
staff_features/resources/resource_calculate_extent.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,18 @@ | ||
Feature: Calculate Extent of a resource | ||
Background: | ||
Given an administrator user is logged in | ||
And a Resource has been created | ||
And the Resource is opened in edit mode | ||
Scenario: Extent sub record is added to the Resource | ||
When the user clicks on 'More' | ||
And the user clicks on 'Calculate Extent' | ||
And the user selects 'Whole' from 'Portion' in the modal | ||
And the user fills in 'Number' with '123456789' in the modal | ||
And the user selects 'Cassettes' from 'Type' in the modal | ||
And the user clicks on 'Create Extent' in the modal | ||
And the user clicks on 'Save' | ||
Then the 'Resource' updated message is displayed | ||
And a new Extent is added to the Resource with the following values | ||
| Portion | Whole | | ||
| Number | 123456789 | | ||
| Type | Cassettes | |
14 changes: 14 additions & 0 deletions
14
staff_features/resources/step_definitions/resource_calculate_extent.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,14 @@ | ||
# frozen_string_literal: true | ||
|
||
Then 'a new Extent is added to the Resource with the following values' do |form_values_table| | ||
extents = all('#resource_extents_ .subrecord-form-list li') | ||
|
||
expect(extents.length).to eq @resource_number_of_extents + 1 | ||
|
||
created_extent = extents.last | ||
|
||
form_values_hash = form_values_table.rows_hash | ||
form_values_hash.each do |field, value| | ||
expect(created_extent.find_field(field).value).to eq value.downcase.gsub(' ', '_') | ||
end | ||
end |