-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
CaseContact validates usage and spec changes - case contact form prep #6061
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
association :creator, factory: :user | ||
casa_case | ||
|
||
contact_types { [create(:contact_type)] } | ||
contact_types { [association(:contact_type)] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not familiar with this. what does it do vs just the create? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will play a little nicer with build/build_stubbed according to the docs, so fewer db hits in those situations. |
||
duration_minutes { 60 } | ||
occurred_at { Time.zone.today } | ||
contact_made { false } | ||
|
@@ -38,12 +38,14 @@ | |
trait :wants_reimbursement do | ||
miles_driven { 456 } | ||
want_driving_reimbursement { true } | ||
volunteer_address { "123 Contact Factory St" } | ||
end | ||
|
||
trait :started_status do | ||
started # enum trait | ||
|
||
casa_case { nil } | ||
contact_types { [] } | ||
draft_case_ids { [] } | ||
medium_type { nil } | ||
occurred_at { nil } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,11 @@ | |
end | ||
|
||
trait :with_assigned_supervisor do | ||
transient { supervisor { create(:supervisor) } } | ||
transient { supervisor { nil } } | ||
|
||
after(:create) do |user, evaluator| | ||
create(:supervisor_volunteer, volunteer: user, supervisor: evaluator.supervisor) | ||
after(:create) do |volunteer, evaluator| | ||
supervisor = evaluator.supervisor || create(:supervisor, casa_org: volunteer.casa_org) | ||
create(:supervisor_volunteer, volunteer:, supervisor:) | ||
end | ||
end | ||
|
||
|
@@ -46,7 +47,7 @@ | |
end | ||
end | ||
|
||
trait :with_disasllow_reimbursement do | ||
trait :with_disallow_reimbursement do | ||
Comment on lines
-49
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol |
||
after(:create) do |user, _| | ||
create(:case_assignment, :disallow_reimbursement, casa_case: create(:casa_case, casa_org: user.casa_org), volunteer: user) | ||
end | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the only actions in the controller, so this is not a behavioral change (except preventing controller errors)