Skip to content

Commit

Permalink
Move public function out of private section
Browse files Browse the repository at this point in the history
  • Loading branch information
Janell-Huyck committed Mar 11, 2024
1 parent 0fac7d3 commit 6458d93
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion spec/features/layouts/form_layout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def verify_three_column_item_widths

def verify_three_column_item_heights
heights = retrieve_item_offsets
puts "heights: #{heights}"

expect(heights[0..2].uniq.size).to eq(1)
expect(heights[2]).not_to eq(heights[3])
end
Expand Down
38 changes: 19 additions & 19 deletions spec/support/helpers/feature_spec_helpers/author_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ def first_author_element
find('#author_group > :first-child')
end

# navigates to the new other publication page and fills out the form.
def create_other_publication
visit new_other_publication_path

# Fill out the fields with the first author's name
first_name_fields.last.set('First0')
last_name_fields.last.set('Last0')

# Fill in the rest of the fields
fill_in 'other_publication[work_title]', with: 'Title'
fill_in 'other_publication[other_title]', with: 'Subtitle'
fill_in 'other_publication[uc_department]', with: 'Department'
fill_in 'other_publication[publication_date]', with: 'Date'
fill_in 'other_publication[url]', with: 'URL'
fill_in 'other_publication[doi]', with: 'DOI'

click_on 'Submit'
end

private

# Returns the collection of author first name fields.
Expand Down Expand Up @@ -80,25 +99,6 @@ def verify_field_value(fields:, index:, expected_value:, field_name:)
expect(actual_value).to eq(expected_value), error_message
end

# navigates to the new other publication page and fills out the form.
def create_other_publication
visit new_other_publication_path

# Fill out the fields with the first author's name
first_name_fields.last.set('First0')
last_name_fields.last.set('Last0')

# Fill in the rest of the fields
fill_in 'other_publication[work_title]', with: 'Title'
fill_in 'other_publication[other_title]', with: 'Subtitle'
fill_in 'other_publication[uc_department]', with: 'Department'
fill_in 'other_publication[publication_date]', with: 'Date'
fill_in 'other_publication[url]', with: 'URL'
fill_in 'other_publication[doi]', with: 'DOI'

click_on 'Submit'
end

# Adds three more authors to a publication. Valid only within
# the context of a feature test with an already created publication.
def add_three_more_authors_to_publication(publication)
Expand Down

0 comments on commit 6458d93

Please sign in to comment.