Skip to content

Commit

Permalink
Rename Rejection Details column to Comments (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-gracia authored Oct 5, 2023
1 parent 55205ea commit 0d7f5ce
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/controllers/system_admin/applicants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def applicant_params
:payment_confirmation_completed_at,
:rejection_completed_at,
:rejection_reason,
:rejection_details,
:comments,
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/application_progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#
# id :bigint not null, primary key
# banking_approval_completed_at :date
# comments :text
# home_office_checks_completed_at :date
# initial_checks_completed_at :date
# payment_confirmation_completed_at :date
# rejection_completed_at :date
# rejection_details :text
# rejection_reason :integer
# school_checks_completed_at :date
# school_investigation_required :boolean default(FALSE), not null
Expand Down
2 changes: 1 addition & 1 deletion app/models/reports/qa_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def rejection_rows(app)

[
app.application_progress.rejection_reason&.humanize,
app.application_progress.rejection_details,
app.application_progress.comments,
]
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/system_admin/applicants/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<%= f.govuk_date_field :payment_confirmation_completed_at, legend: { text: "Payment Confirmation (payslip)", size: "s" } %>
<%= f.govuk_date_field :rejection_completed_at, legend: { text: "Rejection Date", size: "s" } %>
<%= f.govuk_select :rejection_reason, rejection_reasons, label: { text: "Rejection Reason" } %>
<%= f.govuk_text_area :rejection_details, label: { text: 'Rejection Details' }, rows: 3 %>
<%= f.govuk_text_area :comments, label: { text: 'Comments' }, rows: 3 %>

<%= f.govuk_submit("Update") %>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/system_admin/applicants/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
row.with_value(text: @progress.rejection_reason&.humanize )
end
summary_list.with_row do |row|
row.with_key(text: 'Rejection Details')
row.with_value(text: @progress.rejection_details )
row.with_key(text: 'Comments')
row.with_value(text: @progress.comments )
end
end
end %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RenameRejectionDetailsToComments < ActiveRecord::Migration[7.0]
def change
rename_column :application_progresses, :rejection_details, :comments
end
end
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spec/factories/application_progresses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# id :bigint not null, primary key
# banking_approval_completed_at :date
# comments :text
# home_office_checks_completed_at :date
# initial_checks_completed_at :date
# payment_confirmation_completed_at :date
# rejection_completed_at :date
# rejection_details :text
# rejection_reason :integer
# school_checks_completed_at :date
# school_investigation_required :boolean default(FALSE), not null
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin_console/update_progress_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def when_i_submit_a_rejection_with_reason
def when_i_submit_a_rejection_with_reason_and_details
fill_in_rejection_date
select "Suspected fraud", from: "application_progress[rejection_reason]"
fill_in "application_progress[rejection_details]", with: "suspected_fraud"
fill_in "application_progress[comments]", with: "I suspected fraud on this application"
click_button "Update"
end

Expand Down
2 changes: 1 addition & 1 deletion spec/models/application_progress_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# id :bigint not null, primary key
# banking_approval_completed_at :date
# comments :text
# home_office_checks_completed_at :date
# initial_checks_completed_at :date
# payment_confirmation_completed_at :date
# rejection_completed_at :date
# rejection_details :text
# rejection_reason :integer
# school_checks_completed_at :date
# school_investigation_required :boolean default(FALSE), not null
Expand Down
5 changes: 2 additions & 3 deletions spec/models/reports/qa_report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ module Reports
let(:status) { "rejected" }

it "returns the data including rejection reasons in CSV format" do
application = create(:application, application_progress: build(:application_progress, rejection_completed_at: Time.zone.now, status: :rejected, rejection_reason: :request_to_re_submit, rejection_details: "Some details"))

application = create(:application, application_progress: build(:application_progress, rejection_completed_at: Time.zone.now, status: :rejected, rejection_reason: :request_to_re_submit, comments: "Some details"))
expect(report.csv).to include([
application.urn,
application.applicant.full_name,
Expand All @@ -66,7 +65,7 @@ module Reports
application.visa_type,
application.date_of_entry.strftime("%d/%m/%Y"),
application.application_progress.rejection_reason&.humanize,
application.application_progress.rejection_details,
application.application_progress.comments,
].join(","))
end
end
Expand Down

0 comments on commit 0d7f5ce

Please sign in to comment.