Skip to content
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

CasaCase accepts date_in_care #5295

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/casa_cases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def casa_case_params
params.require(:casa_case).permit(
:case_number,
:birth_month_year_youth,
:date_in_care,
:court_report_due_date,
:empty_court_date,
casa_case_contact_types_attributes: [:contact_type_id],
Expand Down
5 changes: 5 additions & 0 deletions spec/requests/casa_cases_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
require "rails_helper"

RSpec.describe "/casa_cases", type: :request do
let(:date_in_care) { Date.today }
let(:organization) { build(:casa_org) }
let(:group) { build(:contact_type_group) }
let(:type1) { create(:contact_type, contact_type_group: group) }
let(:valid_attributes) do
{
case_number: "1234",
birth_month_year_youth: pre_transition_aged_youth_age,
"date_in_care(3i)": date_in_care.day,
"date_in_care(2i)": date_in_care.month,
"date_in_care(1i)": date_in_care.year,
casa_org_id: organization.id,
casa_case_contact_types_attributes: [{contact_type_id: type1.id}]
}
Expand Down Expand Up @@ -158,6 +162,7 @@
casa_case = CasaCase.last
expect(casa_case.casa_org).to eq organization
expect(casa_case.birth_month_year_youth).to eq pre_transition_aged_youth_age
expect(casa_case.date_in_care.to_date).to eq date_in_care
end

it "also responds as json", :aggregate_failures do
Expand Down