Emilias-Site/test/controllers/test/images_controller_test.rb

21 lines
539 B
Ruby

require "test_helper"
include ActiveJob::TestHelper
class Test::ImagesControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get test_images_path
assert_response :success
end
test "should get create" do
file = fixture_file_upload("test_image.jpg", "image/jpeg")
post test_images_path, params: { image: { file: file, title: "test" } }
assert_redirected_to test_images_path
end
teardown do
perform_enqueued_jobs do
ActiveStorage::Blob.all.each(&:purge_later)
end
end
end