Skip to content

Commit

Permalink
Updated NYC Agreement to include Nava. Separate agency agreements. (#210
Browse files Browse the repository at this point in the history
)

* fixed header/title error occurring on payment details page

* updated nyc agreement and added site_translation entries

* updated ma agreement copy
  • Loading branch information
GeorgeCodes19 authored Aug 23, 2024
1 parent 83ec17f commit a7269c3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/app/views/cbv/agreements/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
</ol>

<%= form_with(url: cbv_flow_agreement_path, builder: UswdsFormBuilder, data: { turbo: "false" }) do |f| %>
<%= f.check_box(:agreement, { 'label': t(".checkbox", agency_name: current_site.agency_name) }) %>
<%= f.check_box(:agreement, { 'label': site_translation(".checkbox") }) %>
<%= f.submit t(".get_started") %>
<% end %>
5 changes: 4 additions & 1 deletion app/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ en:
create:
error: You must check the agreement checkbox to proceed.
show:
checkbox: Check this box to agree to let Verify.gov access your payment information and share it with the %{agency_name}.
checkbox:
ma: Check this box to agree to let us access your payment information and share it with the Massachusetts Department of Transitional Assistance.
nyc: Check this box to agree to let Nava access your payment information and share it with New York City Human Resources Administration. We will not use the information for any other purpose nor redisclose it to any other party.
sandbox: Check this box to agree to let Verify.gov access your payment information and share it with the Sandbox Example Agency.
get_started: Get started
header: How verifying your income works
step1: Find your employer or online payroll provider. A payroll provider is the company where you check your paystubs online
Expand Down
51 changes: 38 additions & 13 deletions app/spec/controllers/cbv/agreements_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,51 @@
RSpec.describe Cbv::AgreementsController do
render_views

let(:cbv_flow) { create(:cbv_flow, case_number: "ABC1234", site_id: "sandbox") }
let(:cbv_flow) { create(:cbv_flow) }

before do
session[:cbv_flow_id] = cbv_flow.id
end

it "renders properly" do
get :show
describe "#show" do
it "renders properly" do
get :show
expect(response).to be_successful
end

expect(response).to be_successful
end
context "shows different agreements based on the site_id" do
it "when site is nyc" do
cbv_flow.update(site_id: "nyc")
get :show
expect(response.body).to include I18n.t("cbv.agreements.show.checkbox.nyc")
end

it "displays error when the checkbox is not checked" do
post :create, params: {}
expect(flash[:alert]).to be_present
expect(response).to redirect_to(cbv_flow_agreement_path)
end
it "when site is ma" do
cbv_flow.update(site_id: "ma")
get :show
expect(response.body).to include I18n.t("cbv.agreements.show.checkbox.ma")
end

it "when site is sandbox" do
cbv_flow.update(site_id: "sandbox")
get :show
expect(response.body).to include I18n.t("cbv.agreements.show.checkbox.sandbox")
end
end

context "when the user has not agreed to the terms" do
it "displays error when the checkbox is not checked" do
post :create, params: {}
expect(flash[:alert]).to be_present
expect(response).to redirect_to(cbv_flow_agreement_path)
end
end

it "redirects when checkbox is checked" do
post :create, params: { 'agreement': '1' }
expect(response).to redirect_to(cbv_flow_employer_search_path)
context "when the user has agreed to the terms" do
it "redirects when checkbox is checked" do
post :create, params: { 'agreement': '1' }
expect(response).to redirect_to(cbv_flow_employer_search_path)
end
end
end
end

0 comments on commit a7269c3

Please sign in to comment.