-
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
42072ea
commit fa241c6
Showing
4 changed files
with
83 additions
and
9 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
19 changes: 19 additions & 0 deletions
19
staff_features/digital_objects/step_definitions/digital_object_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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
Then 'the new Digital Object form has the following default values' do |form_values_table| | ||
visit "#{STAFF_URL}/digital_objects/new" | ||
|
||
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 |
22 changes: 22 additions & 0 deletions
22
staff_features/digital_objects/step_definitions/digital_object_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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'a Digital Object has been created' do | ||
visit "#{STAFF_URL}/digital_objects/new" | ||
|
||
fill_in 'digital_object_digital_object_id_', with: "Digital Object Identifier #{@uuid}" | ||
fill_in 'digital_object_title_', with: "Digital Object Title #{@uuid}" | ||
|
||
click_on 'Add Date' | ||
select 'Single', from: 'digital_object_dates__0__date_type_' | ||
fill_in 'digital_object_dates__0__begin_', with: '2000-01-01' | ||
|
||
click_on 'Save' | ||
|
||
wait_for_ajax | ||
expect(find('.alert.alert-success.with-hide-alert').text).to have_text "Digital Object Digital Object Title #{@uuid} Created" | ||
@digital_object_id = current_url.split('::digital_object_').pop | ||
end | ||
|
||
Given 'the user is on the Digital Objects page' do | ||
visit "#{STAFF_URL}/digital_objects" | ||
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