tests: fix broken tests.

* Fix a bug where creating posts failed if IQDB wasn't configured.
* Fix broken Skeb test caused by changed URL.
* Fix broken IP geolocation tests caused by API returning different data.
* Fix broken post regeneration tests.
This commit is contained in:
evazion
2022-01-31 14:14:09 -06:00
parent 65b7c08e33
commit 2bb5ad78fb
4 changed files with 11 additions and 9 deletions

View File

@@ -4,8 +4,7 @@ class PostRegenerationsControllerTest < ActionDispatch::IntegrationTest
context "The post regenerations controller" do
setup do
@mod = create(:moderator_user, name: "yukari", created_at: 1.month.ago)
@upload = assert_successful_upload("test/files/test.jpg", user: @mod)
@post = @upload.post
@post = create(:post_with_file, filename: "test.jpg")
perform_enqueued_jobs # add post to iqdb
end
@@ -60,8 +59,7 @@ class PostRegenerationsControllerTest < ActionDispatch::IntegrationTest
end
should "fix the width and height of exif-rotated images" do
@upload = assert_successful_upload("test/files/test-rotation-90cw.jpg", user: @mod)
@post = @upload.post
@post = create(:post_with_file, filename: "test-rotation-90cw.jpg")
post_auth post_regenerations_path, @mod, params: { post_id: @post.id }
perform_enqueued_jobs