-
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
40d2e37
commit 548d401
Showing
4 changed files
with
68 additions
and
7 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
53 changes: 53 additions & 0 deletions
53
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,53 @@ | ||
# 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 Digital Object appears in the search results list' do | ||
visit "#{STAFF_URL}/digital_objects" | ||
|
||
fill_in 'filter-text', with: "Digital Object Identifier #{@uuid}" | ||
|
||
within '.search-filter' do | ||
find('button').click | ||
end | ||
|
||
search_result_rows = all('#tabledSearchResults tbody tr') | ||
expect(search_result_rows.length).to eq 1 | ||
end | ||
|
||
Then 'the Digital Object is opened in the edit mode' do | ||
wait_for_ajax | ||
expect(current_url).to include 'edit' | ||
expect(@digital_object_id).to eq current_url.split('::digital_object_').pop | ||
end | ||
|
||
Given 'the Digital Object is opened in the view mode' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}" | ||
end | ||
|
||
Then 'the Digital Object Title field has the original value' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
expect(page).to have_field('Title', with: "Digital Object Title #{@uuid}") | ||
end | ||
|
||
Then 'the Digital Object Identifier field has the original value' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
expect(page).to have_field('Identifier', with: "Digital Object Identifier #{@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