-
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
7f30ee5
commit 72afd50
Showing
4 changed files
with
68 additions
and
10 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
16 changes: 16 additions & 0 deletions
16
staff_features/digital_objects/step_definitions/digital_object_delete.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,16 @@ | ||
# frozen_string_literal: true | ||
|
||
When 'the user checks the checkbox of the Digital Object' do | ||
find('#multiselect-item').check | ||
end | ||
|
||
Then 'the Digital Object is deleted' do | ||
expect(@digital_object_id).to_not eq nil | ||
|
||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}/edit" | ||
|
||
expect(find('h2').text).to eq 'Record Not Found' | ||
|
||
expected_text = "The record you've tried to access may no longer exist or you may not have permission to view it." | ||
expect(page).to have_text expected_text | ||
end |
49 changes: 49 additions & 0 deletions
49
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,49 @@ | ||
# 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 '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 | ||
|
||
When 'the user filters by text with the Digital Object title' do | ||
fill_in 'Filter by text', with: "Digital Object Identifier #{@uuid}" | ||
|
||
find('#filter-text').send_keys(:enter) | ||
|
||
rows = [] | ||
checks = 0 | ||
|
||
while checks < 5 | ||
checks += 1 | ||
|
||
begin | ||
rows = all('tr', text: @uuid) | ||
rescue Selenium::WebDriver::Error::JavascriptError | ||
sleep 1 | ||
end | ||
|
||
break if rows.length == 1 | ||
end | ||
end | ||
|
||
Given 'the user is on the Digital Object view page' do | ||
visit "#{STAFF_URL}/digital_objects/#{@digital_object_id}" | ||
end | ||
|
||
Then 'the Digital Objects page is displayed' do | ||
expect(find('h2').text).to have_text 'Digital Objects' | ||
expect(current_url).to include "#{STAFF_URL}/digital_objects" | ||
end | ||
|
||
Then 'the user is still on the Digital Object view page' do | ||
expect(find('h2').text).to eq "Digital Object Title #{@uuid} Digital Object" | ||
expect(current_url).to include "#{STAFF_URL}/digital_objects/#{@digital_object_id}" | ||
end |