-
-
Notifications
You must be signed in to change notification settings - Fork 532
806 use Court Report Status instead of Court Report Submitted #1284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
compwron
merged 2 commits into
rubyforgood:main
from
ChaelCodes:806-court-report-submitted-status
Nov 8, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
6 changes: 6 additions & 0 deletions
6
db/migrate/20201108142333_add_court_report_status_to_casa_cases.rb
This file contains hidden or 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,6 @@ | ||
| class AddCourtReportStatusToCasaCases < ActiveRecord::Migration[6.0] | ||
| def change | ||
| add_column :casa_cases, :court_report_submitted_at, :datetime | ||
| add_column :casa_cases, :court_report_status, :integer, default: 0, not_null: true | ||
| end | ||
| end |
This file contains hidden or 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
14 changes: 14 additions & 0 deletions
14
lib/tasks/deployment/20201108181154_backfill_court_report_submitted_at.rake
This file contains hidden or 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,14 @@ | ||
| namespace :after_party do | ||
| desc 'Deployment task: Backfill court_report_submitted_at and court_report_status' | ||
| task backfill_court_report_submitted_at: :environment do | ||
| puts "Running deploy task 'backfill_court_report_submitted_at'" | ||
|
|
||
| CasaCase.where(court_report_submitted: true).in_batches.update_all(court_report_status: :submitted, | ||
| court_report_submitted_at: Time.current) | ||
|
|
||
| # Update task as completed. If you remove the line below, the task will | ||
| # run with every deploy (or every time you call after_party:run). | ||
| AfterParty::TaskRecord | ||
| .create version: AfterParty::TaskRecorder.new(__FILE__).timestamp | ||
| end | ||
| end | ||
This file contains hidden or 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,46 @@ | ||
| require "rails_helper" | ||
|
|
||
| RSpec.describe CasaCaseDecorator do | ||
| describe "#court_report_submission" do | ||
| subject { casa_case.decorate.court_report_submission } | ||
| let(:casa_case) { build(:casa_case, court_report_status: court_report_status) } | ||
|
|
||
| context "when case_report_status is not_submitted" do | ||
| let(:court_report_status) { :not_submitted } | ||
|
|
||
| it { is_expected.to eq('Not submitted') } | ||
| end | ||
|
|
||
| context "when case_report_status is submitted" do | ||
| let(:court_report_status) { :submitted } | ||
|
|
||
| it { is_expected.to eq('Submitted') } | ||
| end | ||
|
|
||
| context "when case_report_status is in_review" do | ||
| let(:court_report_status) { :in_review } | ||
|
|
||
| it { is_expected.to eq('In review') } | ||
| end | ||
|
|
||
| context "when case_report_status is completed" do | ||
| let(:court_report_status) { :completed } | ||
|
|
||
| it { is_expected.to eq('Completed') } | ||
| end | ||
| end | ||
|
|
||
| describe "#court_report_submission" do | ||
| subject { casa_case.decorate.court_report_submitted_date } | ||
| let(:submitted_time) { Time.parse("Sun Nov 08 11:06:20 2020") } | ||
| let(:casa_case) { build(:casa_case, court_report_submitted_at: submitted_time) } | ||
|
|
||
| it { is_expected.to eq 'November 8, 2020' } | ||
|
|
||
| context 'when report is not submitted' do | ||
| let(:submitted_time) { nil } | ||
|
|
||
| it { is_expected.to be_nil } | ||
| end | ||
| end | ||
| end |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay backfill!