-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CRM457-2335: Risk and value setting (#344)
## Description of change Allow the gem to handle setting risk and high_value flags Bonus: Ensure that the provider app never sees work-in-progress adjustments by a caseworker (I don't think this is a bug at the moment, but we're relying on the provider app _hiding_ these adjustments, which it shouldn't have to do) [Link to relevant ticket](https://dsdmoj.atlassian.net/browse/CRM457-2335)
- Loading branch information
1 parent
887f947
commit 4a64d24
Showing
12 changed files
with
79 additions
and
33 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
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
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,7 @@ | ||
class MakeRiskOptional < ActiveRecord::Migration[8.0] | ||
def change | ||
drop_view :searches, revert_to_version: 7 | ||
change_column :application, :application_risk, :string, null: true | ||
create_view :searches, version: 7 | ||
end | ||
end |
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 |
---|---|---|
@@ -1,22 +1,34 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Show submission" do | ||
before { allow(Tokens::VerificationService).to receive(:call).and_return(valid: true, role: :provider) } | ||
before do | ||
allow(Tokens::VerificationService).to receive(:call).and_return(valid: true, role:) | ||
create(:submission_version, submission:, version: 1, application: { old: :data }) | ||
create(:submission_version, submission:, version: 2, application: { new: :data }) | ||
create(:submission_version, submission:, version: 3, application: { pending: :data }, pending: true) | ||
end | ||
|
||
let(:role) { :provider } | ||
let(:submission) { create :submission, current_version: 2 } | ||
|
||
it "returns a submission" do | ||
submission = create(:submission) | ||
get "/v1/submissions/#{submission.id}" | ||
expect(response).to have_http_status(:ok) | ||
expect(response.parsed_body["application_id"]).to eq submission.id | ||
end | ||
|
||
it "returns the latest version" do | ||
submission = create(:submission, current_version: 2) | ||
create(:submission_version, submission:, version: 1, application: { old: :data }) | ||
create(:submission_version, submission:, version: 2, application: { new: :data }) | ||
|
||
it "returns the latest non-pending version" do | ||
get "/v1/submissions/#{submission.id}" | ||
|
||
expect(response.parsed_body["application"]).to eq({ "new" => "data" }) | ||
end | ||
|
||
context "when viewer is a caseworker" do | ||
let(:role) { :caseworker } | ||
|
||
it "returns the latest version even if it's pending" do | ||
get "/v1/submissions/#{submission.id}" | ||
expect(response.parsed_body["application"]).to eq({ "pending" => "data" }) | ||
end | ||
end | ||
end |
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