-
-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3216] make past court reports like present court reports (#5032)
assumption: we want the dates to mostly match punted on: most_recent_court_date and latest_hearing_date being retrofitted (seems worth revisiting that in a future PR) punted on: a stronger refactor of the two controller methods, but can be convinced its time rearranged context so court date fields could be added in as desired --------- Co-authored-by: Ian Norris <iannorris@Ians-MacBook-Air.local>
- Loading branch information
1 parent
62fb6d5
commit c67f7cb
Showing
12 changed files
with
108 additions
and
49 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -79,6 +79,7 @@ group :test do | |
gem "rake" | ||
gem "selenium-webdriver" | ||
gem "simplecov" | ||
gem "docx" | ||
end | ||
|
||
# gem "pdf-reader", "~> 2.9" |
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
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
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
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
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
Binary file renamed
BIN
+44.1 KB
...tes/default_past_court_date_template.docx → ...les/default_past_court_date_template.docx
Binary file not shown.
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
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
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
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
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,38 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "court_dates/edit", type: :system do | ||
context "with date" | ||
let(:now) { Date.new(2021, 1, 1) } | ||
let(:organization) { create(:casa_org) } | ||
let(:admin) { create(:casa_admin, casa_org: organization) } | ||
let(:volunteer) { create(:volunteer) } | ||
let(:supervisor) { create(:casa_admin, casa_org: organization) } | ||
let!(:casa_case) { create(:casa_case, casa_org: organization) } | ||
let!(:court_date) { create(:court_date, :with_court_details, casa_case: casa_case, date: now - 1.week) } | ||
let!(:future_court_date) { create(:court_date, :with_court_details, casa_case: casa_case, date: now + 1.week) } | ||
|
||
before do | ||
travel_to now | ||
end | ||
|
||
context "as a volunteer" do | ||
it "can download a report which focuses on the court date", js: true do | ||
volunteer.casa_cases = [casa_case] | ||
sign_in volunteer | ||
|
||
visit root_path | ||
click_on "Cases" | ||
click_on casa_case.case_number | ||
|
||
expect(CourtDate.count).to eq 2 | ||
click_on "January 8, 2021" | ||
expect(page).to have_content "Court Date" | ||
|
||
click_on "Download Report" | ||
|
||
wait_for_download | ||
|
||
expect(download_docx.paragraphs.map(&:to_s)).to include("Hearing Date: January 8, 2021") | ||
end | ||
end | ||
end |