Skip to content

Commit

Permalink
Fixed bug in download link in modal (#1131)
Browse files Browse the repository at this point in the history
* Fixed bug in download link in modal

* Fixed breaking test

---------

Co-authored-by: Robert-Anthony Lee-Faison <108823963+leefaisonr@users.noreply.github.com>
  • Loading branch information
kelynch and leefaisonr authored Dec 16, 2024
1 parent f76fa66 commit 11683cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/views/projects/_latest_download_link.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= link_to("Download latest report - generated #{time_ago_in_words(@latest_completed_download.completion_time)} ago", project_file_list_download_path(@latest_completed_download.id, target: "_blank")) %>
<%= link_to("Download latest report - generated #{time_ago_in_words(@latest_completed_download.completion_time)} ago", project_file_list_download_path(job_id: @latest_completed_download.job_id, target: "_blank")) %>
7 changes: 2 additions & 5 deletions spec/system/project_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,13 @@

context "when downloads exist" do
before do
FileInventoryRequest.create!(user_id: sponsor_user.id, project_id: project.id, job_id: 123, state: UserRequest::COMPLETED,
request_details: { project_title: project.title }, completion_time: 5.days.ago)
FileInventoryRequest.create!(user_id: sponsor_user.id, project_id: project.id, job_id: 456, state: UserRequest::COMPLETED,
request_details: { project_title: project.title }, completion_time: 2.days.ago)
FileInventoryJob.new(user_id: sponsor_user.id, project_id: project.id).perform_now
end
it "includes a link to the latest download in the download modal" do
sign_in sponsor_user
visit "/projects/#{project.id}"
click_on("Download Complete List")
expect(page).to have_content("Download latest report - generated 2 days ago")
expect(page).to have_content("Download latest report - generated less than a minute ago")
end
end
end
Expand Down

0 comments on commit 11683cc

Please sign in to comment.