diff --git a/app/controllers/organizations/adoptable_pets_controller.rb b/app/controllers/organizations/adoptable_pets_controller.rb
index 0b60f6d20..f3273f089 100644
--- a/app/controllers/organizations/adoptable_pets_controller.rb
+++ b/app/controllers/organizations/adoptable_pets_controller.rb
@@ -22,14 +22,14 @@ def show
@pet = Pet.find(params[:id])
authorize! @pet, with: Organizations::AdoptablePetPolicy
- if current_user
+ if current_user&.latest_form_submission
@adoption_application =
AdopterApplication.find_by(
- pet: @pet,
- form_submission: current_user.person.form_submission
+ pet_id: @pet.id,
+ form_submission_id: current_user.latest_form_submission.id
) ||
@pet.adopter_applications.build(
- form_submission: current_user.person.form_submission
+ form_submission: current_user.latest_form_submission
)
end
end
diff --git a/app/controllers/organizations/adopter_fosterer/external_form_controller.rb b/app/controllers/organizations/adopter_fosterer/external_form_controller.rb
new file mode 100644
index 000000000..4fe51a9e4
--- /dev/null
+++ b/app/controllers/organizations/adopter_fosterer/external_form_controller.rb
@@ -0,0 +1,21 @@
+module Organizations
+ module AdopterFosterer
+ class ExternalFormController < ApplicationController
+ layout :form_layout
+
+ def index
+ authorize! with: ExternalFormPolicy
+
+ @form_url = Current.organization.external_form_url
+ end
+
+ private
+
+ def form_layout
+ return "adopter_foster_dashboard" if params[:dashboard]
+
+ "application"
+ end
+ end
+ end
+end
diff --git a/app/controllers/organizations/staff/organizations_controller.rb b/app/controllers/organizations/staff/organizations_controller.rb
index e0bd8644a..ac8a497d2 100644
--- a/app/controllers/organizations/staff/organizations_controller.rb
+++ b/app/controllers/organizations/staff/organizations_controller.rb
@@ -26,6 +26,7 @@ def organization_params
:facebook_url,
:instagram_url,
:donation_url,
+ :external_form_url,
locations_attributes: %i[id city_town country province_state]
)
end
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 6209f416b..5c0822429 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -11,10 +11,12 @@ def new
respond_with resource
end
+ # MARK: only adopters are created through this route. Adopters need both the adoper role and a form submission to attach their applications to
def create
super do |resource|
if resource.persisted?
resource.add_role(:adopter, Current.organization)
+ resource.person.form_submissions.create
end
end
end
@@ -55,8 +57,13 @@ def account_update_params
end
def after_sign_up_path_for(resource)
- allowed_to?(:index?, with: Organizations::AdopterFosterDashboardPolicy, context: {organization: Current.organization}) ?
- adopter_fosterer_dashboard_index_path : root_path
+ return root_path unless allowed_to?(:index?, with: Organizations::AdopterFosterDashboardPolicy, context: {organization: Current.organization})
+
+ if Current.organization.external_form_url
+ adopter_fosterer_external_form_index_path
+ else
+ adopter_fosterer_dashboard_index_path
+ end
end
# check for id (i.e., record saved) and send mail
diff --git a/app/models/adopter_application.rb b/app/models/adopter_application.rb
index 31a2484d7..29b1a5a2c 100644
--- a/app/models/adopter_application.rb
+++ b/app/models/adopter_application.rb
@@ -40,7 +40,8 @@ class AdopterApplication < ApplicationRecord
:adoption_pending,
:withdrawn,
:successful_applicant,
- :adoption_made]
+ :adoption_made,
+ :awaiting_data]
# remove adoption_made status as not necessary for staff
def self.app_review_statuses
diff --git a/app/models/concerns/authorizable.rb b/app/models/concerns/authorizable.rb
index a82f54ebf..76ff79366 100644
--- a/app/models/concerns/authorizable.rb
+++ b/app/models/concerns/authorizable.rb
@@ -19,6 +19,7 @@ def permission?(name)
manage_likes
view_adopted_pets
read_pet_tasks
+ view_external_form
].freeze
FOSTERER_PERMISSIONS = %i[
diff --git a/app/models/form_submission.rb b/app/models/form_submission.rb
index 07d5b4662..3c0db0f6a 100644
--- a/app/models/form_submission.rb
+++ b/app/models/form_submission.rb
@@ -32,4 +32,6 @@ class FormSubmission < ApplicationRecord
has_many :adopter_applications
has_many :form_answers, dependent: :destroy
+
+ delegate :user, to: :person
end
diff --git a/app/models/organization.rb b/app/models/organization.rb
index 46ca35fe0..54f296126 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -2,16 +2,17 @@
#
# Table name: organizations
#
-# id :bigint not null, primary key
-# donation_url :text
-# email :string not null
-# facebook_url :text
-# instagram_url :text
-# name :string not null
-# phone_number :string
-# slug :string not null
-# created_at :datetime not null
-# updated_at :datetime not null
+# id :bigint not null, primary key
+# donation_url :text
+# email :string not null
+# external_form_url :text
+# facebook_url :text
+# instagram_url :text
+# name :string not null
+# phone_number :string
+# slug :string not null
+# created_at :datetime not null
+# updated_at :datetime not null
#
# Indexes
#
diff --git a/app/models/person.rb b/app/models/person.rb
index ed4ddb669..1ed6734f3 100644
--- a/app/models/person.rb
+++ b/app/models/person.rb
@@ -25,9 +25,10 @@ class Person < ApplicationRecord
acts_as_tenant(:organization)
- has_one :form_submission, dependent: :destroy
- has_many :form_answers, through: :form_submission
- has_many :adopter_applications, through: :form_submission
+ has_one :latest_form_submission, -> { order(created_at: :desc) }, class_name: "FormSubmission"
+ has_many :form_submissions, dependent: :destroy
+ has_many :form_answers, through: :form_submissions
+ has_many :adopter_applications, through: :form_submissions
has_many :likes, dependent: :destroy
has_many :liked_pets, through: :likes, source: :pet
has_many :matches # , dependent: :destroy
diff --git a/app/models/user.rb b/app/models/user.rb
index 4b32dee16..3696be4ec 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -76,6 +76,8 @@ class User < ApplicationRecord
before_save :downcase_email
+ delegate :latest_form_submission, to: :person
+
# get user accounts for staff in a given organization
def self.organization_staff(org_id)
User.includes(:staff_account)
diff --git a/app/policies/adopter_application_policy.rb b/app/policies/adopter_application_policy.rb
index eb124d81c..9d911d504 100644
--- a/app/policies/adopter_application_policy.rb
+++ b/app/policies/adopter_application_policy.rb
@@ -5,9 +5,9 @@ class AdopterApplicationPolicy < ApplicationPolicy
pre_check :verify_pet_appliable!, only: %i[create?]
relation_scope do |relation|
- return relation.none unless user.person.form_submission
+ return relation.none unless user.latest_form_submission
- relation.where(form_submission_id: user.person.form_submission.id)
+ relation.where(form_submission_id: user.latest_form_submission.id)
end
def update?
@@ -35,7 +35,7 @@ def already_applied?
end
def verify_form_submission!
- deny! unless user.person.form_submission.present?
+ deny! unless user.latest_form_submission.present?
end
def verify_pet_appliable!
diff --git a/app/policies/organizations/adopter_fosterer/external_form_policy.rb b/app/policies/organizations/adopter_fosterer/external_form_policy.rb
new file mode 100644
index 000000000..a52533cae
--- /dev/null
+++ b/app/policies/organizations/adopter_fosterer/external_form_policy.rb
@@ -0,0 +1,9 @@
+module Organizations
+ module AdopterFosterer
+ class ExternalFormPolicy < ApplicationPolicy
+ def index?
+ permission?(:view_external_form)
+ end
+ end
+ end
+end
diff --git a/app/views/layouts/adopter_foster_dashboard.html.erb b/app/views/layouts/adopter_foster_dashboard.html.erb
index ac40c2b36..c28b5f3c4 100644
--- a/app/views/layouts/adopter_foster_dashboard.html.erb
+++ b/app/views/layouts/adopter_foster_dashboard.html.erb
@@ -82,6 +82,13 @@
FAQ
<% end %>
+ <% if Current.organization.external_form_url.present? %>
+
+ <%= active_link_to adopter_fosterer_external_form_index_path(dashboard: true), class: "nav-link" do %>
+ My Info
+ <% end %>
+
+ <% end %>
<%= active_link_to new_dev_contact_path, class: "nav-link" do %>
Feedback
diff --git a/app/views/organizations/adoptable_pets/show.html.erb b/app/views/organizations/adoptable_pets/show.html.erb
index bf019ba1d..a27765b50 100644
--- a/app/views/organizations/adoptable_pets/show.html.erb
+++ b/app/views/organizations/adoptable_pets/show.html.erb
@@ -144,7 +144,7 @@
%>
<% end %>
<% else %>
- <% if AdopterApplication.exists?(form_submission: current_user.person.form_submission, pet: @pet) %>
+ <% if AdopterApplication.exists?(form_submission: current_user.latest_form_submission, pet: @pet) %>
<%= "#{t('organizations.adoptable_pets.show.application_status')} #{@adoption_application.human_enum_name(:status) || t('.status.default')}" %>
@@ -157,14 +157,6 @@
<%= image_tag('green_check.png', height: '21') %>
<% end %>
- <% elsif %>
- <%# FIXME: This section was missed during the remove of AdopterFosterProfile but I think it requires FormSubmission to be ready to refactor %>
- <%# Once the form_submission CRUD and policy are created, should use conditional like the below %>
- <%# elsif allowed_to?(:create?, FormSubmission) %>
-
- <%= t('.complete_your_profile') %>
-
- <%= link_to t('.complete_my_profile'), "#", class: 'custom-btn-pink' %>
<% end %>
<% end %>
<% else %>
diff --git a/app/views/organizations/adopter_fosterer/external_form/index.html.erb b/app/views/organizations/adopter_fosterer/external_form/index.html.erb
new file mode 100644
index 000000000..5aaee19ff
--- /dev/null
+++ b/app/views/organizations/adopter_fosterer/external_form/index.html.erb
@@ -0,0 +1,15 @@
+
+
+ <% if params[:dashboard] %>
+
<%= t("organizations.adopter_fosterer.form_instructions.dashboard") %>
+ <% else %>
+
<%= t("organizations.adopter_fosterer.form_instructions.index", organization_name: Current.tenant.name) %>
+ <% end %>
+ <%= link_to 'View pets', adoptable_pets_path, class: "btn btn-primary float-end" %>
+
+
+
diff --git a/app/views/organizations/staff/organizations/_form.html.erb b/app/views/organizations/staff/organizations/_form.html.erb
index df02f0e42..66a73b8be 100644
--- a/app/views/organizations/staff/organizations/_form.html.erb
+++ b/app/views/organizations/staff/organizations/_form.html.erb
@@ -28,6 +28,10 @@
<%= form.text_field :email, placeholder: "john@email.com", class: 'form-control' %>
+
+
+ <%= form.text_field :external_form_url, label: "Adoption Form", placeholder: "https://example.com", class: 'form-control' %>
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 54d5669c7..530d85f2a 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -535,6 +535,7 @@ en:
adoption_pending: "Adoption Pending"
withdrawn: "Withdrawn"
successful_applicant: "Successful Applicant"
+ awaiting_data: "Awaiting Data"
tabs:
overview:
status:
@@ -626,6 +627,9 @@ en:
destroy:
success: "%{name} removed from your liked pets."
failed: "Error, %{name} not removed from your liked pets."
+ form_instructions:
+ index: "Please complete this form. %{organization_name} needs this information in order to process your application(s)."
+ dashboard: If you need to update your information, you can do so by filling out a new copy of this form. Please only submit a new copy if there has been a change. Unnecessary submissions may delay the processing of your application(s).
attachments:
purge:
success: "Attachment removed"
diff --git a/config/routes.rb b/config/routes.rb
index e43a8f01a..11f6c2fba 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -67,6 +67,7 @@
resources :files, only: [:index], module: :adopted_pets
resources :tasks, only: [:index], module: :adopted_pets
end
+ resources :external_form, only: %i[index]
end
end
diff --git a/db/migrate/20240825155349_add_external_form_url_to_organizations.rb b/db/migrate/20240825155349_add_external_form_url_to_organizations.rb
new file mode 100644
index 000000000..9896547f7
--- /dev/null
+++ b/db/migrate/20240825155349_add_external_form_url_to_organizations.rb
@@ -0,0 +1,5 @@
+class AddExternalFormUrlToOrganizations < ActiveRecord::Migration[7.1]
+ def change
+ add_column :organizations, :external_form_url, :text
+ end
+end
diff --git a/db/migrate/20240902111455_change_adopter_foster_account_null_on_adopter_applications.rb b/db/migrate/20240902111455_change_adopter_foster_account_null_on_adopter_applications.rb
new file mode 100644
index 000000000..4c2eb00f9
--- /dev/null
+++ b/db/migrate/20240902111455_change_adopter_foster_account_null_on_adopter_applications.rb
@@ -0,0 +1,6 @@
+class ChangeAdopterFosterAccountNullOnAdopterApplications < ActiveRecord::Migration[7.1]
+ def change
+ remove_index :adopter_applications, column: [:adopter_foster_account_id], name: :index_adopter_applications_on_adopter_foster_account_id
+ change_column_null(:adopter_applications, :adopter_foster_account_id, true)
+ end
+end
diff --git a/db/migrate/20240902115121_remove_pet_adopter_foster_account_index_from_adopter_applications.rb b/db/migrate/20240902115121_remove_pet_adopter_foster_account_index_from_adopter_applications.rb
new file mode 100644
index 000000000..201b8f900
--- /dev/null
+++ b/db/migrate/20240902115121_remove_pet_adopter_foster_account_index_from_adopter_applications.rb
@@ -0,0 +1,5 @@
+class RemovePetAdopterFosterAccountIndexFromAdopterApplications < ActiveRecord::Migration[7.1]
+ def change
+ remove_index :adopter_applications, column: [:pet_id, :adopter_foster_account_id], name: :index_adopter_applications_on_account_and_pet
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index ff1671445..c09c5f40a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -179,6 +179,7 @@
t.text "donation_url"
t.text "facebook_url"
t.text "instagram_url"
+ t.text "external_form_url"
t.index ["slug"], name: "index_organizations_on_slug", unique: true
end
diff --git a/db/seeds/01_alta.rb b/db/seeds/01_alta.rb
index 8ecc90609..5c80adcbb 100644
--- a/db/seeds/01_alta.rb
+++ b/db/seeds/01_alta.rb
@@ -3,7 +3,8 @@
slug: "alta",
email: "alta@email.com",
phone_number: "250 816 8212",
- custom_page: CustomPage.new(hero: "Where every paw finds a home", about: "Alta was founded by an incredible group of ladies in April of 2020. Our initial goal was to have both a rescue and a spay/neuter clinic, however, we quickly realized that it would be more efficient to separate into two organizations.")
+ custom_page: CustomPage.new(hero: "Where every paw finds a home", about: "Alta was founded by an incredible group of ladies in April of 2020. Our initial goal was to have both a rescue and a spay/neuter clinic, however, we quickly realized that it would be more efficient to separate into two organizations."),
+ external_form_url: "https://docs.google.com/forms/d/e/1FAIpQLSf9bI-kboxyQQB5I1W5pt0R25u9pHoXI7o3jQHKu1P4K-61mA/viewform?embedded=true"
)
ActsAsTenant.with_tenant(@organization) do
@@ -75,7 +76,7 @@
@user_adopter_one.add_role(:adopter, @organization)
- @adopter_one.create_form_submission!
+ @adopter_one.form_submissions.create!
@adopter_two = Person.create!(
email: "adopter2@alta.com",
@@ -94,7 +95,7 @@
@user_adopter_two.add_role(:adopter, @organization)
- @adopter_two.create_form_submission!
+ @adopter_two.form_submissions.create!
@adopter_three = Person.create!(
email: "adopter3@alta.com",
@@ -113,7 +114,7 @@
@user_adopter_three.add_role(:adopter, @organization)
- @adopter_three.create_form_submission!
+ @adopter_three.form_submissions.create!
@fosterer_one = Person.create!(
email: "fosterer1@alta.com",
@@ -236,7 +237,7 @@
match_application = AdopterApplication.create!(
pet_id: Pet.first.id,
- form_submission_id: @adopter_one.form_submission.id,
+ form_submission_id: @adopter_one.form_submissions.first.id,
status: :successful_applicant
)
diff --git a/db/seeds/02_baja.rb b/db/seeds/02_baja.rb
index ef0c01a1c..842181aa4 100644
--- a/db/seeds/02_baja.rb
+++ b/db/seeds/02_baja.rb
@@ -75,7 +75,7 @@
@user_adopter_one.add_role(:adopter, @organization)
- @adopter_one.create_form_submission!
+ @adopter_one.form_submissions.create!
@adopter_two = Person.create!(
email: "adopter2@baja.com",
@@ -94,7 +94,7 @@
@user_adopter_two.add_role(:adopter, @organization)
- @adopter_two.create_form_submission!
+ @adopter_two.form_submissions.create!
@adopter_three = Person.create!(
email: "adopter3@baja.com",
@@ -113,7 +113,7 @@
@user_adopter_three.add_role(:adopter, @organization)
- @adopter_three.create_form_submission!
+ @adopter_three.form_submissions.create!
@fosterer_one = Person.create!(
email: "fosterer1@baja.com",
@@ -189,7 +189,7 @@
match_application = AdopterApplication.create!(
pet_id: Pet.first.id,
- form_submission_id: @adopter_one.form_submission.id,
+ form_submission_id: @adopter_one.form_submissions.first.id,
status: :successful_applicant
)
diff --git a/test/controllers/organizations/adopter_fosterer/adopter_applications_controller_test.rb b/test/controllers/organizations/adopter_fosterer/adopter_applications_controller_test.rb
index b40b15c2d..fd8fc2d7d 100644
--- a/test/controllers/organizations/adopter_fosterer/adopter_applications_controller_test.rb
+++ b/test/controllers/organizations/adopter_fosterer/adopter_applications_controller_test.rb
@@ -7,6 +7,7 @@ class Organizations::AdopterFosterer::AdopterApplicationsControllerTest < Action
setup do
@user = create(:adopter)
+ @form_submission = @user.person.latest_form_submission
sign_in @user
end
@@ -45,7 +46,6 @@ class Organizations::AdopterFosterer::AdopterApplicationsControllerTest < Action
context "#create" do
setup do
@pet = create(:pet)
- @form_submission = create(:form_submission, person: @user.person)
@params = {adopter_application: {
pet_id: @pet.id,
form_submission_id: @form_submission.id
@@ -65,8 +65,7 @@ class Organizations::AdopterFosterer::AdopterApplicationsControllerTest < Action
context "#update" do
setup do
- @form_submission = create(:form_submission)
- @adopter_application = create(:adopter_application, user: @user, form_submission: @form_submission)
+ @adopter_application = create(:adopter_application, form_submission: @form_submission)
@params = {adopter_application: {
status: "withdrawn"
}}
diff --git a/test/controllers/organizations/adopter_fosterer/external_forms_controller_test.rb b/test/controllers/organizations/adopter_fosterer/external_forms_controller_test.rb
new file mode 100644
index 000000000..d6404e410
--- /dev/null
+++ b/test/controllers/organizations/adopter_fosterer/external_forms_controller_test.rb
@@ -0,0 +1,13 @@
+require "test_helper"
+
+class Organizations::AdopterFosterer::ExternalFormsControllerTest < ActionDispatch::IntegrationTest
+ setup do
+ user = create(:adopter)
+ sign_in user
+ end
+
+ test "should get index" do
+ get adopter_fosterer_external_form_index_url
+ assert_response :success
+ end
+end
diff --git a/test/controllers/organizations/staff/adoption_application_reviews_controller_test.rb b/test/controllers/organizations/staff/adoption_application_reviews_controller_test.rb
index 15c45676e..2d59343f3 100644
--- a/test/controllers/organizations/staff/adoption_application_reviews_controller_test.rb
+++ b/test/controllers/organizations/staff/adoption_application_reviews_controller_test.rb
@@ -104,10 +104,6 @@ class Organizations::Staff::AdoptionApplicationReviewsControllerTest < ActionDis
@pet = create(:pet)
create(:form_submission, person: create(:person, first_name: "David", last_name: "Attenborough"))
create(:form_submission, person: create(:person, first_name: "Jane", last_name: "Goodall"))
- # adopter_foster_account1 = create(:adopter_foster_account,
- # user: create(:user, first_name: "David", last_name: "Attenborough"))
- # adopter_foster_account2 = create(:adopter_foster_account,
- # user: create(:user, first_name: "Jane", last_name: "Goodall"))
create(:adopter_application, pet: @pet, form_submission: create(:form_submission))
create(:adopter_application, pet: @pet, form_submission: create(:form_submission))
diff --git a/test/controllers/registrations_controller_test.rb b/test/controllers/registrations_controller_test.rb
index e6dd72f00..46614440a 100644
--- a/test/controllers/registrations_controller_test.rb
+++ b/test/controllers/registrations_controller_test.rb
@@ -12,6 +12,14 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
assert_equal true, has_role
end
+ test "should create form submission when user is persisted" do
+ assert_difference "FormSubmission.count", 1 do
+ registration_params = {user: attributes_for(:user)}
+
+ post user_registration_url, params: registration_params
+ end
+ end
+
test "should get new with dashboard layout when signed in as staff" do
user = create(:admin)
organization = user.staff_account.organization
diff --git a/test/factories/users.rb b/test/factories/users.rb
index 60ab3cf33..83c408aad 100644
--- a/test/factories/users.rb
+++ b/test/factories/users.rb
@@ -17,9 +17,15 @@
end
end
+ trait :with_person do
+ person
+ end
+
factory :adopter do
+ person
after(:build) do |user, _context|
user.add_role(:adopter, user.organization)
+ create(:form_submission, person: user.person)
end
end
diff --git a/test/models/person_test.rb b/test/models/person_test.rb
index 90c54581b..e6c098df1 100644
--- a/test/models/person_test.rb
+++ b/test/models/person_test.rb
@@ -13,8 +13,8 @@ class PersonTest < ActiveSupport::TestCase
end
context "associations" do
- should have_one(:form_submission).dependent(:destroy)
- should have_many(:form_answers).through(:form_submission)
+ should have_many(:form_submissions).dependent(:destroy)
+ should have_many(:form_answers).through(:form_submissions)
end
context "database validations" do
diff --git a/test/policies/adopter_application_policy_test.rb b/test/policies/adopter_application_policy_test.rb
index ae8839501..53283e1ea 100644
--- a/test/policies/adopter_application_policy_test.rb
+++ b/test/policies/adopter_application_policy_test.rb
@@ -35,21 +35,21 @@ class AdopterApplicationPolicyTest < ActiveSupport::TestCase
context "when there are applications that do not belong to user" do
setup do
@user_applications = [
- create(:adopter_application, user: @user, form_submission: @form_submission),
- create(:adopter_application, user: @user, form_submission: @form_submission)
+ create(:adopter_application, form_submission: @form_submission),
+ create(:adopter_application, form_submission: @form_submission)
]
@other_application = create(:adopter_application, form_submission: create(:form_submission))
end
should "return only user's applications" do
expected = @user_applications.map(&:id)
-
assert_equal(expected, @scope.call)
end
end
context "when user has no applications" do
setup do
+ @form_submission = create(:form_submission, person_id: @user.person_id)
@other_application = create(:adopter_application, form_submission: create(:form_submission))
end
@@ -258,7 +258,7 @@ class AdopterApplicationPolicyTest < ActiveSupport::TestCase
end
end
- context "when adopter account belongs to user" do
+ context "when form submission belongs to user" do
setup do
@user = create(:adopter)
form_submission = create(:form_submission, person: @user.person)
diff --git a/test/system/adoption_fosterer_test.rb b/test/system/adoption_fosterer_test.rb
index 9d0cb2564..9ee9802c2 100644
--- a/test/system/adoption_fosterer_test.rb
+++ b/test/system/adoption_fosterer_test.rb
@@ -3,10 +3,9 @@
class AdoptionFostererTest < ApplicationSystemTestCase
setup do
@user = create(:adopter_fosterer)
- @custom_page = create(:custom_page, :with_about_us_image)
@pet = create(:pet)
- create(:adopter_application, pet: @pet, form_submission: @user.person.form_submission || @user.person.create_form_submission)
+ create(:adopter_application, pet: @pet, form_submission: @user.person.form_submissions.create)
sign_in @user
end