Skip to content

Commit

Permalink
temp first draft feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rawOrlando committed Sep 27, 2024
1 parent 05d13ab commit de587b6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/models/forms/grad_scholarship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class GradScholarship < Contribution

def copy_attributes
super
@tufts_pdf.bibliographic_citation = [bibliographic_citation] if bibliographic_citation
@tufts_pdf.subject = [department]
@tufts_pdf.creator_department = [creator_dept]
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/contribute/deposit_view/_grad_scholarship.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
Tufts.autocomplete()
</script>

<%= f.text_field :advisor, label: 'Advisor' %>
<%= f.select :embargo, standard_embargos, label: 'Embargo', help: 'An embargo will restrict all access to your work until the selected time has passed' %>
<%= f.text_field :bibliographic_citation, label: 'Bibliographic Citation', help: '<b>Optional</b> - the bibliographic citation field may be left blank'.html_safe %>
<%= f.text_area :abstract, label: 'Short Description', rows: 5, class: 'col-sm-8' %>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
let(:user) { FactoryBot.create(:user) }
let(:admin) { FactoryBot.create(:admin) }
let(:title) { FFaker::Movie.unique.title }
let(:advisory) { "advisory" }
let(:bibliographic_citation) { FFaker::Book.genre }
# let(:advisory) { "advisory" }
let(:short_description) { FFaker::Book.description }

before do
Expand All @@ -38,9 +39,18 @@
page.execute_script %{ $('ul.ui-autocomplete li.ui-menu-item:contains("Dept. of Geology")').trigger('mouseenter').click() }
expect(find_field('Department').value).to eq 'Dept. of Geology'

fill_in 'Advisor', with: advisory
fill_in "contribution_bibliographic_citation", with: bibliographic_citation

click_button 'Agree & Deposit'
expect(page).to have_content 'Your deposit has been submitted for approval.'

visit("/concern/pdfs/#{created_pdf.id}")
expect(page).to have_content(title)
expect(page).to have_content(bibliographic_citation)
expect(page).to have_content("In Collection")
expect(page).to have_content("General Graduate Scholarship")
visit("/concern/pdfs/#{created_pdf.id}/edit")
# TODO: look for department
expect(find_by_id("pdf_bibliographic_citation").value).to eq bibliographic_citation
end
end

0 comments on commit de587b6

Please sign in to comment.