Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
khiga8 committed Dec 15, 2024
1 parent bef3812 commit 862da02
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@ class ExternalFormUploadControllerTest < ActionDispatch::IntegrationTest
@adopter2 = create(:adopter, email: "[email protected]")
sign_in admin
end

should "Creates new form submission" do
assert_difference "@adopter.person.form_submissions.count" do
post staff_external_form_upload_index_path, params: @params
end
end

should "It does not create form answers for adopter2" do
assert_no_difference "@adopter2.person.form_submissions.count" do
post staff_external_form_upload_index_path, params: @params
end
end

should "shows success feedback" do
post staff_external_form_upload_index_path, params: @params, as: :turbo_stream

assert_response :success
assert_turbo_stream(action: "replace", count: 1) do
assert_select "h5", text: "File successfully scanned"
end
end
end
end

context "error" do
setup do
file = fixture_file_upload("google_form_error_sample.csv", "text/csv")
@params = {files: file}
admin = create(:admin)
adopter = create(:adopter, email: "[email protected]")
create(:adopter, email: "[email protected]")
sign_in admin
end

should "shows error feedback" do
post staff_external_form_upload_index_path, params: @params, as: :turbo_stream

assert_response :success
assert_turbo_stream(action: "replace", count: 1) do
assert_select "h5", text: "File scanned: 1 error(s) present"
Expand Down

0 comments on commit 862da02

Please sign in to comment.