-
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
56f1055
commit 083fe2a
Showing
3 changed files
with
34 additions
and
3 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
30 changes: 30 additions & 0 deletions
30
staff_features/resources/step_definitions/resource_component_edit_default_values.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,30 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'the user is on the Component Record Default page' do | ||
visit "#{STAFF_URL}/archival_objects/defaults" | ||
end | ||
|
||
Then 'the Component Record Defaults page is displayed' do | ||
expect(current_url).to include '/archival_objects/defaults' | ||
end | ||
|
||
Then 'the new Resource Component form has the following default values' do |form_values_table| | ||
visit "#{STAFF_URL}/resources/#{@resource_id}/edit" | ||
wait_for_ajax | ||
click_on 'Add Child' | ||
wait_for_ajax | ||
|
||
form_values = form_values_table.hashes | ||
|
||
form_values.each do |row| | ||
section_title = find('h3', text: row['form_section']) | ||
section = section_title.ancestor('section') | ||
expect(section[:id]).to_not eq nil | ||
|
||
within section do | ||
field = find_field(row['form_field']) | ||
|
||
expect(field.value.downcase).to eq row['form_value'].downcase | ||
end | ||
end | ||
end |