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 30, 2024
1 parent 05d13ab commit f1e2822
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions app/models/forms/grad_scholarship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ class GradScholarship < Contribution
attr_accessor :department
validates :department, presence: true

self.attributes += [:advisor]
self.ignore_attributes += [:advisor]
attr_accessor :advisor
validates :advisor, presence: true

protected

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,7 @@
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(:short_description) { FFaker::Book.description }

before do
Expand All @@ -38,7 +38,7 @@
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.'
Expand Down

0 comments on commit f1e2822

Please sign in to comment.