-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Digital Object edit default values #56
Open
kdimopulu
wants to merge
2
commits into
master
Choose a base branch
from
digital_object_edit_default_values
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+95
−12
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
staff_features/digital_objects/digital_object_edit_default_values.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,17 @@ | ||
Feature: Digital Object Edit Default Values | ||
Background: | ||
Given an administrator user is logged in | ||
And the Pre-populate Records option is checked in Repository Preferences | ||
And a Digital Object has been created | ||
And the user is on the Digital Objects page | ||
Scenario: Edit Default Values | ||
When the user clicks on 'Edit Default Values' | ||
And the user clicks on 'Digital Object' in the dropdown menu | ||
And the user fills in 'Title' with 'Test Digital Object' | ||
And the user selects 'Text' from 'Digital Object Type' | ||
And the user clicks on 'Save' | ||
Then the 'Defaults' updated message is displayed | ||
And the new Digital Object form has the following default values | ||
| form_section | form_field | form_value | | ||
| Basic Information | Title | Test Digital Object | | ||
| Basic Information | Digital Object Type | Text | |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here as #55, is
wait_for_ajax
actually necessary?