tests: fix various broken tests.

This commit is contained in:
evazion
2020-01-17 19:21:20 -06:00
parent 20f893161b
commit b7350b8fe0
5 changed files with 15 additions and 30 deletions

View File

@@ -39,7 +39,7 @@ class PostTest < ActiveSupport::TestCase
@upload = UploadService.new(FactoryBot.attributes_for(:jpg_upload)).start!
@post = @upload.post
Favorite.add(post: @post, user: @user)
create(:favorite_group).add!(@post.id)
create(:favorite_group, post_ids: [@post.id])
end
should "delete the files" do
@@ -2737,9 +2737,9 @@ class PostTest < ActiveSupport::TestCase
should "generate the correct urls for animated gifs" do
@post = FactoryBot.build(:post, md5: "deadbeef", file_ext: "gif", tag_string: "animated_gif")
assert_equal("https://#{Socket.gethostname}/data/preview/deadbeef.jpg", @post.preview_file_url)
assert_equal("https://#{Socket.gethostname}/data/deadbeef.gif", @post.large_file_url)
assert_equal("https://#{Socket.gethostname}/data/deadbeef.gif", @post.file_url)
assert_equal("https://localhost/data/preview/deadbeef.jpg", @post.preview_file_url)
assert_equal("https://localhost/data/deadbeef.gif", @post.large_file_url)
assert_equal("https://localhost/data/deadbeef.gif", @post.file_url)
end
end