diff --git a/app/controllers/state_file/questions/az_prior_last_names_controller.rb b/app/controllers/state_file/questions/az_prior_last_names_controller.rb index a3dbcc8975..d9e0aa8414 100644 --- a/app/controllers/state_file/questions/az_prior_last_names_controller.rb +++ b/app/controllers/state_file/questions/az_prior_last_names_controller.rb @@ -2,6 +2,10 @@ module StateFile module Questions class AzPriorLastNamesController < QuestionsController include ReturnToReviewConcern + + def update + update_for_device_id_collection(current_intake&.initial_efile_device_info) + end end end end diff --git a/app/controllers/state_file/questions/post_data_transfer_controller.rb b/app/controllers/state_file/questions/data_review_controller.rb similarity index 86% rename from app/controllers/state_file/questions/post_data_transfer_controller.rb rename to app/controllers/state_file/questions/data_review_controller.rb index 3cdb8a5293..00db326344 100644 --- a/app/controllers/state_file/questions/post_data_transfer_controller.rb +++ b/app/controllers/state_file/questions/data_review_controller.rb @@ -1,6 +1,6 @@ module StateFile module Questions - class PostDataTransferController < QuestionsController + class DataReviewController < QuestionsController def edit super # Redirect to offboarding here if not eligible @@ -16,8 +16,6 @@ def edit ip_address: ip_for_irs, intake: current_intake, ) - - redirect_to next_path if acts_like_production? end private diff --git a/app/controllers/state_file/questions/income_review_controller.rb b/app/controllers/state_file/questions/income_review_controller.rb index dbeb905cf8..1ec4b26be7 100644 --- a/app/controllers/state_file/questions/income_review_controller.rb +++ b/app/controllers/state_file/questions/income_review_controller.rb @@ -7,10 +7,6 @@ class IncomeReviewController < QuestionsController def set_sorted_vars @w2s = current_intake.state_file_w2s&.sort_by { |w2| [w2.employee_name, w2.employer_name] } end - - def update - update_for_device_id_collection(current_intake&.initial_efile_device_info) - end end end end diff --git a/app/forms/state_file/az_prior_last_names_form.rb b/app/forms/state_file/az_prior_last_names_form.rb index beb31ca3d7..41fb2a4a10 100644 --- a/app/forms/state_file/az_prior_last_names_form.rb +++ b/app/forms/state_file/az_prior_last_names_form.rb @@ -1,10 +1,15 @@ module StateFile class AzPriorLastNamesForm < QuestionsForm set_attributes_for :intake, :prior_last_names, :has_prior_last_names + set_attributes_for :state_file_efile_device_info, :device_id + validates :has_prior_last_names, inclusion: { in: %w[yes no], message: :blank } validates :prior_last_names, presence: true, allow_blank: false, if: -> { has_prior_last_names == "yes" } def save + efile_info = StateFileEfileDeviceInfo.find_by(event_type: "initial_creation", intake: @intake) + efile_info&.update!(attributes_for(:state_file_efile_device_info)) + if has_prior_last_names == "no" @intake.update(has_prior_last_names: "no", prior_last_names: nil) else diff --git a/app/forms/state_file/income_review_form.rb b/app/forms/state_file/income_review_form.rb deleted file mode 100644 index bbdb1f35f2..0000000000 --- a/app/forms/state_file/income_review_form.rb +++ /dev/null @@ -1,10 +0,0 @@ -module StateFile - class IncomeReviewForm < QuestionsForm - set_attributes_for :state_file_efile_device_info, :device_id - - def save - efile_info = StateFileEfileDeviceInfo.find_by(event_type: "initial_creation", intake: @intake) - efile_info&.update!(attributes_for(:state_file_efile_device_info)) - end - end -end \ No newline at end of file diff --git a/app/forms/state_file/name_dob_form.rb b/app/forms/state_file/name_dob_form.rb index e66d133df4..2e55f5bb29 100644 --- a/app/forms/state_file/name_dob_form.rb +++ b/app/forms/state_file/name_dob_form.rb @@ -15,6 +15,7 @@ class NameDobForm < QuestionsForm :spouse_suffix, :primary_birth_date_month, :primary_birth_date_day, :primary_birth_date_year, :spouse_birth_date_month, :spouse_birth_date_day, :spouse_birth_date_year + set_attributes_for :state_file_efile_device_info, :device_id delegate :ask_months_in_home?, @@ -48,6 +49,9 @@ def dependents end def save + efile_info = StateFileEfileDeviceInfo.find_by(event_type: "initial_creation", intake: @intake) + efile_info&.update!(attributes_for(:state_file_efile_device_info)) + attributes_to_update = { primary_first_name: primary_first_name, primary_middle_initial: primary_middle_initial, diff --git a/app/lib/navigation/state_file_az_question_navigation.rb b/app/lib/navigation/state_file_az_question_navigation.rb index 12397bf805..88e1553809 100644 --- a/app/lib/navigation/state_file_az_question_navigation.rb +++ b/app/lib/navigation/state_file_az_question_navigation.rb @@ -23,7 +23,7 @@ class StateFileAzQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::WaitingToLoadDataController), ]), Navigation::NavigationSection.new("state_file.navigation.section_5", [ - Navigation::NavigationStep.new(StateFile::Questions::PostDataTransferController, false), + Navigation::NavigationStep.new(StateFile::Questions::DataReviewController), Navigation::NavigationStep.new(StateFile::Questions::FederalInfoController), Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false), Navigation::NavigationStep.new(StateFile::Questions::NameDobController), diff --git a/app/lib/navigation/state_file_id_question_navigation.rb b/app/lib/navigation/state_file_id_question_navigation.rb index e3900bdd79..c9ec7a69ac 100644 --- a/app/lib/navigation/state_file_id_question_navigation.rb +++ b/app/lib/navigation/state_file_id_question_navigation.rb @@ -25,7 +25,7 @@ class StateFileIdQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::WaitingToLoadDataController), ]), Navigation::NavigationSection.new("state_file.navigation.section_5", [ - Navigation::NavigationStep.new(StateFile::Questions::PostDataTransferController, false), + Navigation::NavigationStep.new(StateFile::Questions::DataReviewController), Navigation::NavigationStep.new(StateFile::Questions::FederalInfoController), Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false), Navigation::NavigationStep.new(StateFile::Questions::IncomeReviewController), diff --git a/app/lib/navigation/state_file_md_question_navigation.rb b/app/lib/navigation/state_file_md_question_navigation.rb index e62f2dfafb..2313754df4 100644 --- a/app/lib/navigation/state_file_md_question_navigation.rb +++ b/app/lib/navigation/state_file_md_question_navigation.rb @@ -25,7 +25,7 @@ class StateFileMdQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::WaitingToLoadDataController), ]), Navigation::NavigationSection.new("state_file.navigation.section_5", [ - Navigation::NavigationStep.new(StateFile::Questions::PostDataTransferController, false), + Navigation::NavigationStep.new(StateFile::Questions::DataReviewController), Navigation::NavigationStep.new(StateFile::Questions::MdPermanentAddressController), # Federal info does not show to users Navigation::NavigationStep.new(StateFile::Questions::FederalInfoController), diff --git a/app/lib/navigation/state_file_nc_question_navigation.rb b/app/lib/navigation/state_file_nc_question_navigation.rb index e1d8a72194..789d490eff 100644 --- a/app/lib/navigation/state_file_nc_question_navigation.rb +++ b/app/lib/navigation/state_file_nc_question_navigation.rb @@ -26,7 +26,7 @@ class StateFileNcQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::WaitingToLoadDataController), ]), Navigation::NavigationSection.new("state_file.navigation.section_5", [ - Navigation::NavigationStep.new(StateFile::Questions::PostDataTransferController, false), + Navigation::NavigationStep.new(StateFile::Questions::DataReviewController), Navigation::NavigationStep.new(StateFile::Questions::FederalInfoController), Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false), Navigation::NavigationStep.new(StateFile::Questions::NameDobController), diff --git a/app/lib/navigation/state_file_nj_question_navigation.rb b/app/lib/navigation/state_file_nj_question_navigation.rb index df8b26340b..6eb4bbd5e5 100644 --- a/app/lib/navigation/state_file_nj_question_navigation.rb +++ b/app/lib/navigation/state_file_nj_question_navigation.rb @@ -24,7 +24,7 @@ class StateFileNjQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::WaitingToLoadDataController), ]), Navigation::NavigationSection.new("state_file.navigation.section_5", [ - Navigation::NavigationStep.new(StateFile::Questions::PostDataTransferController, false), + Navigation::NavigationStep.new(StateFile::Questions::DataReviewController), # Federal info does not show to users Navigation::NavigationStep.new(StateFile::Questions::FederalInfoController), Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false), diff --git a/app/lib/navigation/state_file_ny_question_navigation.rb b/app/lib/navigation/state_file_ny_question_navigation.rb index cecc24e37f..8468ee8558 100644 --- a/app/lib/navigation/state_file_ny_question_navigation.rb +++ b/app/lib/navigation/state_file_ny_question_navigation.rb @@ -27,7 +27,7 @@ class StateFileNyQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio Navigation::NavigationStep.new(StateFile::Questions::WaitingToLoadDataController), ]), Navigation::NavigationSection.new("state_file.navigation.section_5", [ - Navigation::NavigationStep.new(StateFile::Questions::PostDataTransferController, false), + Navigation::NavigationStep.new(StateFile::Questions::DataReviewController), Navigation::NavigationStep.new(StateFile::Questions::FederalInfoController), Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false), Navigation::NavigationStep.new(StateFile::Questions::NameDobController), diff --git a/app/models/state_file_base_intake.rb b/app/models/state_file_base_intake.rb index cd16c555f2..dcabec39ca 100644 --- a/app/models/state_file_base_intake.rb +++ b/app/models/state_file_base_intake.rb @@ -355,7 +355,7 @@ def controller_for_current_step end rescue StandardError if hashed_ssn.present? - StateFile::Questions::PostDataTransferController + StateFile::Questions::DataReviewController else StateFile::Questions::TermsAndConditionsController end diff --git a/app/views/state_file/questions/az_prior_last_names/edit.html.erb b/app/views/state_file/questions/az_prior_last_names/edit.html.erb index 510b02c94c..ce3e72d551 100644 --- a/app/views/state_file/questions/az_prior_last_names/edit.html.erb +++ b/app/views/state_file/questions/az_prior_last_names/edit.html.erb @@ -4,7 +4,10 @@
<%= t(".subtitle") %>
- <%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %> + <%= form_with model: @form, url: { action: :update }, local: true, method: "put", + data: { efile_security_information: true, form_name: "state_file_az_prior_last_names_form" }, + builder: VitaMinFormBuilder do |f| %> + <%= f.hidden_field(:device_id) %>+ <%= t(".partially_complete_description") %> + <%= image_tag("icons/exclamation.svg", alt: "") %> +
+ + + <%= t(".filing_status_title") %> + ++ <%= t(".complete_description") %> + <%= image_tag("icons/check.svg", alt: "") %> +
+ + + <%= t(".income_and_deductions_title") %> + ++ <%= t(".partially_complete_description") %> + <%= image_tag("icons/exclamation.svg", alt: "") %> +
+ + + <%= t(".state_tax_withheld_title", name: current_state_name) %> + ++ <%= t(".complete_description") %> + <%= image_tag("icons/check.svg", alt: "") %> +
+ <%= form_with model: @form, url: { action: :update }, data: { efile_security_information: true, form_name: "state_file_data_review_form" }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %> + <%= f.hidden_field(:device_id) %> + <%= f.continue %> + <% end %> + + <% unless acts_like_production? %> + <%= + link_to( + "I'm on a #{Rails.env} environment, let me edit the response XML", + StateFile::Questions::FederalInfoController.to_path_helper, + class: 'dev-button', + id: 'visit_federal_info_controller' + ) + %> + <% end %> +<% end %> diff --git a/app/views/state_file/questions/income_review/edit.html.erb b/app/views/state_file/questions/income_review/edit.html.erb index bdeca7f9fa..d9ab94c106 100644 --- a/app/views/state_file/questions/income_review/edit.html.erb +++ b/app/views/state_file/questions/income_review/edit.html.erb @@ -89,9 +89,5 @@<%= t('.title1') %>
<%= t('.title2') %>
- <%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %> + <%= form_with model: @form, url: { action: :update }, method: :put, + data: { efile_security_information: true, form_name: "state_file_name_dob_form" }, + local: true, builder: VitaMinFormBuilder, class: 'form-card' do |f| %> + <%= f.hidden_field(:device_id) %>diff --git a/app/views/state_file/questions/post_data_transfer/edit.html.erb b/app/views/state_file/questions/post_data_transfer/edit.html.erb deleted file mode 100644 index f5242d75ff..0000000000 --- a/app/views/state_file/questions/post_data_transfer/edit.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<% title = t('.title') %> -<% content_for :page_title, title %> - -<% content_for :card do %> - <%= link_to t("general.continue"), next_path, class: "button button--wide button--primary text--centered" %> - <% unless acts_like_production? %> - <%= - link_to( - "I'm on a #{Rails.env} environment, let me edit the response XML", - StateFile::Questions::FederalInfoController.to_path_helper, - class: 'dev-button', - id: 'visit_federal_info_controller' - ) - %> - <% end %> -<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 6c3a78de27..4ba406ff0e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2360,6 +2360,15 @@ en: subtitle: With an account, you’ll receive status updates on your state tax return. text_message_option: Text me a code title: Next, create your account with a quick code + data_review: + edit: + basic_household_info_title: Basic household information + complete_description: Complete + filing_status_title: Filing status + income_and_deductions_title: Income and deductions + partially_complete_description: Partially complete + state_tax_withheld_title: "%{name} state tax withheld" + title: Your federal tax return is now transferred. We completed some sections to save you time. data_transfer_offboarding: edit: ineligible_reason: @@ -3201,9 +3210,6 @@ en: action: Send code phone_number_label: Your phone number title: Enter your phone number - post_data_transfer: - edit: - title: Non-prod page only primary_state_id: edit: ny_subtitle: This information is required for all NY residents with a state-issued ID. diff --git a/config/locales/es.yml b/config/locales/es.yml index 8c3a5f9109..3330da0ffc 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -2334,6 +2334,15 @@ es: subtitle: Con una cuenta recibirás notificaciones sobre el estado de tu declaración de impuestos estatales. text_message_option: Enviar código por mensaje de texto. title: Ahora crea tu cuenta con un código + data_review: + edit: + basic_household_info_title: Información básica del hogar + complete_description: Completo + filing_status_title: Estado civil para la declaración + income_and_deductions_title: Ingresos y deducciones + partially_complete_description: Parcialmente completa + state_tax_withheld_title: Retención de impuestos estatales de %{name} + title: Tu declaración de impuestos federales se ha transferido. Hemos completado algunas partes para ahorrarte tiempo. data_transfer_offboarding: edit: ineligible_reason: @@ -3188,9 +3197,6 @@ es: action: Enviar el código phone_number_label: Tu número de teléfono title: Ingresa tu número de teléfono - post_data_transfer: - edit: - title: Solo página sin producción primary_state_id: edit: ny_subtitle: Esta información es necesaria para todos los residentes de Nueva York con una identificación emitida por el estado. diff --git a/spec/controllers/state_file/intake_logins_controller_spec.rb b/spec/controllers/state_file/intake_logins_controller_spec.rb index 546f05fe46..f276a2d1ec 100644 --- a/spec/controllers/state_file/intake_logins_controller_spec.rb +++ b/spec/controllers/state_file/intake_logins_controller_spec.rb @@ -415,7 +415,7 @@ post :update, params: params expect(subject.current_state_file_az_intake).to eq(intake) - expect(response).to redirect_to questions_post_data_transfer_path + expect(response).to redirect_to questions_data_review_path expect(session["warden.user.state_file_az_intake.key"].first.first).to eq intake.id end @@ -567,7 +567,7 @@ expect(subject.current_state_file_az_intake).to eq(intake) expect(intake.reload.unfinished_intake_ids).to match_array ["3", current_unfinished_intake.id.to_s] - expect(response).to redirect_to questions_post_data_transfer_path + expect(response).to redirect_to questions_data_review_path expect(session["warden.user.state_file_az_intake.key"].first.first).to eq intake.id end end diff --git a/spec/controllers/state_file/questions/az_prior_last_names_controller_spec.rb b/spec/controllers/state_file/questions/az_prior_last_names_controller_spec.rb index 8fadfe0ed4..38506c1c09 100644 --- a/spec/controllers/state_file/questions/az_prior_last_names_controller_spec.rb +++ b/spec/controllers/state_file/questions/az_prior_last_names_controller_spec.rb @@ -7,6 +7,16 @@ end describe "#update" do + let!(:efile_device_info) { create :state_file_efile_device_info, :initial_creation, intake: intake, device_id: nil } + let(:device_id) { "ABC123" } + let(:params) do + { state_file_az_prior_last_names_form: { + has_prior_last_names: "yes", + prior_last_names: "McTestface", + device_id: device_id + } } + end + # use the return_to_review_concern shared example if the page # should skip to the review page when the return_to_review param is present # requires form_params to be set with any other required params @@ -16,9 +26,26 @@ state_file_az_prior_last_names_form: { has_prior_last_names: "yes", prior_last_names: "McTestface", + device_id: "ABC123" } } end end + + context "without device id information due to JS being disabled" do + let(:device_id) { nil } + + it "flashes an alert and does re-renders edit" do + post :update, params: params + expect(flash[:alert]).to eq(I18n.t("general.enable_javascript")) + end + end + + context "with device id" do + it "updates device id" do + post :update, params: params + expect(efile_device_info.reload.device_id).to eq "ABC123" + end + end end end \ No newline at end of file diff --git a/spec/controllers/state_file/questions/post_data_transfer_controller_spec.rb b/spec/controllers/state_file/questions/data_review_controller_spec.rb similarity index 75% rename from spec/controllers/state_file/questions/post_data_transfer_controller_spec.rb rename to spec/controllers/state_file/questions/data_review_controller_spec.rb index 2dd832fa09..37f6d27064 100644 --- a/spec/controllers/state_file/questions/post_data_transfer_controller_spec.rb +++ b/spec/controllers/state_file/questions/data_review_controller_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -RSpec.describe StateFile::Questions::PostDataTransferController do +RSpec.describe StateFile::Questions::DataReviewController do let(:intake) { create :state_file_az_intake } before do sign_in intake @@ -8,32 +8,10 @@ end describe "#edit" do - - context "when environment is production" do - before do - allow(Rails.env).to receive(:production?).and_return(true) - end - - it "redirects to the next path" do - get :edit - - expect(response).not_to render_template :edit - expect(response).to redirect_to(StateFile::Questions::NameDobController.to_path_helper) - end - end - - context "when environment is not production" do - it "displays the Data Review edit page" do - get :edit - - expect(response).to render_template :edit - end - end - context "with valid federal data" do it "renders edit template and creates an initial StateFileEfileDeviceInfo" do expect do - get :edit + get :edit, params: { state_file_data_review_form: { device_id: "ABC123" } } end.to change(StateFileEfileDeviceInfo, :count).by(1) efile_info = StateFileEfileDeviceInfo.last @@ -41,6 +19,7 @@ expect(efile_info.ip_address.to_s).to eq "72.34.67.178" expect(efile_info.device_id).to eq nil expect(efile_info.intake).to eq intake + expect(response).to render_template :edit end end diff --git a/spec/controllers/state_file/questions/income_review_controller_spec.rb b/spec/controllers/state_file/questions/income_review_controller_spec.rb index a58a068697..f1e3b936cf 100644 --- a/spec/controllers/state_file/questions/income_review_controller_spec.rb +++ b/spec/controllers/state_file/questions/income_review_controller_spec.rb @@ -15,13 +15,6 @@ spouse_last_name: spouse_last_name ) end - let(:params) do - { state_file_income_review_form: { - device_id: device_id - } } - end - let!(:efile_device_info) { create :state_file_efile_device_info, :initial_creation, intake: intake, device_id: nil } - let(:device_id) { "ABC123" } before do sign_in intake end @@ -32,14 +25,14 @@ # should skip to the review page when the return_to_review param is present # requires form_params to be set with any other required params it_behaves_like :return_to_review_concern do - let(:form_params) { params } + let(:form_params) { {} } end end describe "W-2s card" do context "when there are no w2s" do it "does not show the card" do - get :edit, params: params + get :edit expect(response.body).not_to have_text "Jobs (W-2)" end @@ -50,7 +43,7 @@ let!(:state_file_w2_2) { create :state_file_w2, employee_name: "Chicken Person", employer_name: "First Corporation", state_file_intake: intake } it "shows a summary of each W2" do - get :edit, params: params + get :edit expect(response.body).to have_text "Jobs (W-2)" expect(response.body).to have_text "Egg Person" @@ -76,7 +69,7 @@ it "shows a summary of each" do primary_1099g = create(:state_file1099_g, intake: intake, payer_name: "Payeur", recipient: :primary) spouse_1099g = create(:state_file1099_g, intake: intake, payer_name: "Payure", recipient: :spouse) - get :edit, params: params + get :edit expect(response.body).to have_text "Unemployment benefits (1099-G)" expect(response.body).to have_text "Payeur" @@ -90,7 +83,7 @@ context "when there are no 1099Gs" do it "shows a message" do - get :edit, params: params + get :edit expect(response.body).to have_text "Unemployment benefits (1099-G)" expect(response.body).to have_text "State info to be collected" @@ -102,7 +95,7 @@ let(:fed_unemployment) { 0 } it "does not show the unemployment card" do - get :edit, params: params + get :edit expect(response.body).not_to have_text "Unemployment benefits (1099-G)" end @@ -121,7 +114,7 @@ let(:fed_ssb) { 10 } let(:fed_taxable_ssb) { 0 } it "shows the SSA card" do - get :edit, params: params + get :edit expect(response.body).to have_text "Social Security benefits (SSA-1099)" end end @@ -130,7 +123,7 @@ let(:fed_ssb) { 0 } let(:fed_taxable_ssb) { 10 } it "shows the SSA card" do - get :edit, params: params + get :edit expect(response.body).to have_text "Social Security benefits (SSA-1099)" end end @@ -140,7 +133,7 @@ let(:fed_taxable_ssb) { 0 } it "doesn't show the SSA card" do - get :edit, params: params + get :edit expect(response.body).not_to have_text "Social Security benefits (SSA-1099)" end end @@ -153,7 +146,7 @@ it "shows a summary of each" do primary_1099r = create(:state_file1099_r, intake: intake, payer_name: "Payeur", recipient_name: 'Prim Rose') spouse_1099r = create(:state_file1099_r, intake: intake, payer_name: "Payure", recipient_name: 'Sprout Vine') - get :edit, params: params + get :edit expect(response.body).to have_text "Retirement income (1099-R)" expect(response.body).to have_text "Payeur" @@ -167,7 +160,7 @@ context "when there are no 1099Rs" do it "does not show any information bout 1099Rs" do - get :edit, params: params + get :edit expect(response.body).not_to have_text "Retirement income (1099-R)" end @@ -179,7 +172,7 @@ context "when filer has no 1099-INT" do it "does not show the interest income card" do - get :edit, params: params + get :edit expect(response.body).not_to have_text "Interest income (1099-INT)" end end @@ -190,25 +183,9 @@ end it "shows the interest income card" do - get :edit, params: params + get :edit expect(response.body).to have_text "Interest income (1099-INT)" end end end - - context "without device id information due to JS being disabled" do - let(:device_id) { nil } - - it "flashes an alert and does re-renders edit" do - post :update, params: params - expect(flash[:alert]).to eq(I18n.t("general.enable_javascript")) - end - end - - context "with device id" do - it "updates device id" do - post :update, params: params - expect(efile_device_info.reload.device_id).to eq "ABC123" - end - end end diff --git a/spec/controllers/state_file/questions/name_dob_controller_spec.rb b/spec/controllers/state_file/questions/name_dob_controller_spec.rb index 0222180d7d..151b48b501 100644 --- a/spec/controllers/state_file/questions/name_dob_controller_spec.rb +++ b/spec/controllers/state_file/questions/name_dob_controller_spec.rb @@ -2,9 +2,11 @@ RSpec.describe StateFile::Questions::NameDobController do let(:intake) { create :state_file_az_intake } + let(:device_id) { "ABC123" } let(:params) do { state_file_name_dob_form: { + device_id: device_id, primary_first_name: "Jo", primary_last_name: "Parker", primary_birth_date_month: "8", @@ -13,11 +15,21 @@ }, } end + let!(:efile_device_info) { create :state_file_efile_device_info, :initial_creation, intake: intake, device_id: nil } before do sign_in intake end + describe "#update" do + context "with device id" do + it "updates device id" do + post :update, params: params + expect(efile_device_info.reload.device_id).to eq "ABC123" + end + end + end + describe "#edit" do let(:state_file_analytics) { intake.state_file_analytics } diff --git a/spec/controllers/state_file/questions/waiting_to_load_data_controller_spec.rb b/spec/controllers/state_file/questions/waiting_to_load_data_controller_spec.rb index fe4660a10a..8c1ce43098 100644 --- a/spec/controllers/state_file/questions/waiting_to_load_data_controller_spec.rb +++ b/spec/controllers/state_file/questions/waiting_to_load_data_controller_spec.rb @@ -35,7 +35,7 @@ it 'redirects to the next page' do get :edit, params: { authorizationCode: 'abcde'} - expect(response).to redirect_to(StateFile::Questions::PostDataTransferController.to_path_helper) + expect(response).to redirect_to(StateFile::Questions::DataReviewController.to_path_helper) end end end diff --git a/spec/features/state_file/complete_intake_spec.rb b/spec/features/state_file/complete_intake_spec.rb index 7192e017c1..0a60742a78 100644 --- a/spec/features/state_file/complete_intake_spec.rb +++ b/spec/features/state_file/complete_intake_spec.rb @@ -27,6 +27,9 @@ step_through_df_data_transfer + expect(page).to have_text I18n.t("state_file.questions.data_review.edit.title") + click_on I18n.t("general.continue") + # name dob page expect(page).to have_text I18n.t("state_file.questions.name_dob.edit.title1", year: filing_year, state: "ny") expect(page).to have_text I18n.t("state_file.questions.name_dob.edit.title2") @@ -166,6 +169,9 @@ step_through_df_data_transfer("Transfer Old sample") + expect(page).to have_text I18n.t("state_file.questions.data_review.edit.title") + click_on I18n.t("general.continue") + expect(page).to have_text I18n.t("state_file.questions.name_dob.edit.title1", year: filing_year, state: "az") expect(page).to have_text I18n.t("state_file.questions.name_dob.edit.title2") expect(page).to have_text "Your responses are saved. If you need a break, you can come back and log in to your account at fileyourstatetaxes.org." @@ -334,6 +340,9 @@ step_through_df_data_transfer("Transfer Nick") + expect(page).to have_text I18n.t("state_file.questions.data_review.edit.title") + click_on I18n.t("general.continue") + expect(page).to have_text I18n.t("state_file.questions.name_dob.edit.title1", year: filing_year, state: "nc") expect(page).to have_text I18n.t("state_file.questions.name_dob.edit.title2") expect(page).to have_text "Your responses are saved. If you need a break, you can come back and log in to your account at fileyourstatetaxes.org." @@ -432,6 +441,9 @@ step_through_df_data_transfer + expect(page).to have_text I18n.t("state_file.questions.data_review.edit.title") + click_on I18n.t("general.continue") + expect(page).to have_text "Here are the income forms we transferred from your federal tax return." click_on I18n.t("general.continue") @@ -537,6 +549,9 @@ step_through_df_data_transfer("Transfer Zeus two w2s") + expect(page).to have_text I18n.t("state_file.questions.data_review.edit.title") + click_on I18n.t("general.continue") + expect(page).to have_text I18n.t("state_file.questions.md_permanent_address.edit.title", filing_year: filing_year) choose I18n.t("general.affirmative") click_on I18n.t("general.continue") @@ -633,6 +648,9 @@ step_through_df_data_transfer("Transfer Minimal") + expect(page).to have_text I18n.t("state_file.questions.data_review.edit.title") + click_on I18n.t("general.continue") + expect(page).to have_text I18n.t("state_file.questions.income_review.edit.title") click_on I18n.t("general.continue") diff --git a/spec/features/state_file/editing_df_xml_spec.rb b/spec/features/state_file/editing_df_xml_spec.rb index d3537f5494..4fff523b57 100644 --- a/spec/features/state_file/editing_df_xml_spec.rb +++ b/spec/features/state_file/editing_df_xml_spec.rb @@ -27,6 +27,7 @@ xml_before = StateFileNyIntake.last.raw_direct_file_data.strip + expect(page).to have_text I18n.t('state_file.questions.data_review.edit.title') click_on I18n.t("general.continue") expect(page).to have_text I18n.t('state_file.questions.name_dob.edit.title1') @@ -49,7 +50,8 @@ click_on I18n.t("state_file.questions.terms_and_conditions.edit.accept") step_through_df_data_transfer("Transfer Alexis hoh w2 and 1099") - click_on "Go back" + + expect(page).to have_text I18n.t('state_file.questions.data_review.edit.title') xml_before = StateFileAzIntake.last.raw_direct_file_data.strip find("#visit_federal_info_controller").click @@ -139,7 +141,8 @@ click_on I18n.t("state_file.questions.terms_and_conditions.edit.accept") step_through_df_data_transfer("Transfer Nick") - click_on "Go back" + + expect(page).to have_text I18n.t('state_file.questions.data_review.edit.title') xml_before = StateFileNcIntake.last.direct_file_data raw_xml_before = StateFileNcIntake.last.raw_direct_file_data.strip diff --git a/spec/features/state_file/login_spec.rb b/spec/features/state_file/login_spec.rb index 899c9fda7f..f5f0b2ba01 100644 --- a/spec/features/state_file/login_spec.rb +++ b/spec/features/state_file/login_spec.rb @@ -53,7 +53,7 @@ fill_in "Enter your Social Security number or ITIN. For example, 123-45-6789.", with: ssn click_on "Continue" - expect(page).to have_text "let me edit the response XML" + expect(page).to have_text "Your federal tax return is now transferred." end scenario "signing in with email" do @@ -78,6 +78,6 @@ fill_in "Enter your Social Security number or ITIN. For example, 123-45-6789.", with: ssn click_on "Continue" - expect(page).to have_text "let me edit the response XML" + expect(page).to have_text "Your federal tax return is now transferred." end end diff --git a/spec/forms/state_file/az_prior_last_names_form_spec.rb b/spec/forms/state_file/az_prior_last_names_form_spec.rb index c394c64be9..519260c577 100644 --- a/spec/forms/state_file/az_prior_last_names_form_spec.rb +++ b/spec/forms/state_file/az_prior_last_names_form_spec.rb @@ -3,6 +3,7 @@ RSpec.describe StateFile::AzPriorLastNamesForm do describe "#valid?" do let(:intake) { create :state_file_az_intake } + let!(:efile_device_info) { create :state_file_efile_device_info, :initial_creation, intake: intake, device_id: nil } context "with empty last names" do let(:invalid_params) do diff --git a/spec/forms/state_file/income_review_form_spec.rb b/spec/forms/state_file/income_review_form_spec.rb deleted file mode 100644 index 327c291847..0000000000 --- a/spec/forms/state_file/income_review_form_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require "rails_helper" - -RSpec.describe StateFile::IncomeReviewForm do - let!(:intake) { create :state_file_az_intake } - let!(:efile_device_info) { create :state_file_efile_device_info, :initial_creation, intake: intake, device_id: nil } - let(:device_id) { "AA" * 20 } - let(:params) do - { - device_id: device_id, - } - end - - describe "#save" do - it "saves the device id" do - form = described_class.new(intake, params) - expect(form).to be_valid - form.save - - intake.reload - expect(intake.initial_efile_device_info.device_id).to eq device_id - end - end -end diff --git a/spec/forms/state_file/name_dob_form_spec.rb b/spec/forms/state_file/name_dob_form_spec.rb index 00c86ebcc9..b4d32c02bb 100644 --- a/spec/forms/state_file/name_dob_form_spec.rb +++ b/spec/forms/state_file/name_dob_form_spec.rb @@ -4,8 +4,10 @@ let!(:intake) { create :state_file_az_intake, dependents: [create(:state_file_dependent), create(:state_file_dependent)] } let!(:first_dependent) { intake.dependents.first } let(:second_dependent) { intake.dependents.second } + let!(:efile_device_info) { create :state_file_efile_device_info, :initial_creation, intake: intake, device_id: nil } let(:valid_params) do { + device_id: "ABC123", primary_first_name: "Taliesen", primary_last_name: "Testingson", primary_middle_initial: "T", @@ -81,6 +83,7 @@ def params_with_values_from_intake(params, intake) spouse_birth_date_month: "", spouse_birth_date_day: "", spouse_birth_date_year: "", + device_id: "ABC123", } end before { allow(intake).to receive_messages(filing_status_mfj?: true) } @@ -187,6 +190,7 @@ def params_with_values_from_intake(params, intake) primary_birth_date_month: "3", primary_birth_date_day: "12", primary_birth_date_year: "1987", + device_id: "ABC123" } end diff --git a/spec/lib/navigation/state_file_az_question_navigation_spec.rb b/spec/lib/navigation/state_file_az_question_navigation_spec.rb index b860c434e1..9368800252 100644 --- a/spec/lib/navigation/state_file_az_question_navigation_spec.rb +++ b/spec/lib/navigation/state_file_az_question_navigation_spec.rb @@ -15,7 +15,7 @@ StateFile::Questions::InitiateDataTransferController, StateFile::Questions::CanceledDataTransferController, # show? false StateFile::Questions::WaitingToLoadDataController, - StateFile::Questions::PostDataTransferController, + StateFile::Questions::DataReviewController, StateFile::Questions::FederalInfoController, StateFile::Questions::DataTransferOffboardingController, StateFile::Questions::NameDobController, diff --git a/spec/lib/navigation/state_file_ny_question_navigation_spec.rb b/spec/lib/navigation/state_file_ny_question_navigation_spec.rb index 928cbdc9ee..26f69f4f4d 100644 --- a/spec/lib/navigation/state_file_ny_question_navigation_spec.rb +++ b/spec/lib/navigation/state_file_ny_question_navigation_spec.rb @@ -19,7 +19,7 @@ StateFile::Questions::InitiateDataTransferController, StateFile::Questions::CanceledDataTransferController, # show? false StateFile::Questions::WaitingToLoadDataController, - StateFile::Questions::PostDataTransferController, + StateFile::Questions::DataReviewController, StateFile::Questions::FederalInfoController, StateFile::Questions::DataTransferOffboardingController, StateFile::Questions::NameDobController, diff --git a/spec/models/efile_error_spec.rb b/spec/models/efile_error_spec.rb index ff662748f9..8d0b3d067b 100644 --- a/spec/models/efile_error_spec.rb +++ b/spec/models/efile_error_spec.rb @@ -46,6 +46,7 @@ "canceled-data-transfer", "code-verified", "contact-preference", + "data-review", "data-transfer-offboarding", "declined-terms-and-conditions", "eligibility-offboarding", @@ -110,7 +111,6 @@ "ny-third-party-designee", "nyc-residency", "phone-number", - "post-data-transfer", "primary-state-id", "return-status", "spouse-state-id", diff --git a/spec/support/helpers/state_file_intake_helper.rb b/spec/support/helpers/state_file_intake_helper.rb index 4c34264c59..fa26034363 100644 --- a/spec/support/helpers/state_file_intake_helper.rb +++ b/spec/support/helpers/state_file_intake_helper.rb @@ -128,7 +128,6 @@ def step_through_df_data_transfer(sample_name = "Transfer my #{filing_year} fede unless Capybara.current_driver == Capybara.javascript_driver find_link("HIDDEN BUTTON", visible: :any).click end - click_on I18n.t("general.continue") end def assert_flow_explorer_sample_params_includes_everything(us_state)