fix specs
This commit is contained in:
@@ -8,7 +8,7 @@ RUN apt-get update && \
|
|||||||
wget -q https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
wget -q https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
||||||
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
||||||
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \
|
||||||
apt-get -y install -qq apt-utils build-essential automake libssl-dev libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev imagemagick libmagickcore-dev libmagickwand-dev sendmail-bin sendmail postgresql-client libpq-dev nginx ssh coreutils ffmpeg mkvtoolnix emacs24-nox telnet && \
|
apt-get -y install -qq apt-utils build-essential automake libssl-dev libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev imagemagick libmagickcore-dev libmagickwand-dev sendmail-bin sendmail postgresql-client libpq-dev nginx ssh coreutils ffmpeg mkvtoolnix emacs24-nox telnet libgif-dev && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
cd /tmp && \
|
cd /tmp && \
|
||||||
wget -q https://github.com/jcupitt/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.gz && \
|
wget -q https://github.com/jcupitt/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.gz && \
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class PostReplacementsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
|
|
||||||
@user = create(:moderator_user, can_approve_posts: true, created_at: 1.month.ago)
|
@user = create(:moderator_user, can_approve_posts: true, created_at: 1.month.ago)
|
||||||
@user.as_current do
|
@user.as_current do
|
||||||
@post = create(:post)
|
@post = create(:post, source: "https://google.com")
|
||||||
@post_replacement = create(:post_replacement, post: @post)
|
@post_replacement = create(:post_replacement, post: @post)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -22,7 +22,7 @@ class PostReplacementsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
format: :json,
|
format: :json,
|
||||||
post_id: @post.id,
|
post_id: @post.id,
|
||||||
post_replacement: {
|
post_replacement: {
|
||||||
replacement_url: "https://www.google.com/intl/en_ALL/images/logo.gif",
|
replacement_url: "https://raikou1.donmai.us/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,9 +36,9 @@ class PostReplacementsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal("https://www.google.com/intl/en_ALL/images/logo.gif", @post.source)
|
assert_equal("https://raikou1.donmai.us/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg", @post.source)
|
||||||
assert_equal("e80d1c59a673f560785784fb1ac10959", @post.md5)
|
assert_equal("d34e4cf0a437a5d65f8e82b7bcd02606", @post.md5)
|
||||||
assert_equal("e80d1c59a673f560785784fb1ac10959", Digest::MD5.file(@post.file(:original)).hexdigest)
|
assert_equal("d34e4cf0a437a5d65f8e82b7bcd02606", Digest::MD5.file(@post.file(:original)).hexdigest)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -734,10 +734,18 @@ class UploadServiceTest < ActiveSupport::TestCase
|
|||||||
as_user do
|
as_user do
|
||||||
@post1.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247350")
|
@post1.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247350")
|
||||||
@post2.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247364")
|
@post2.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247364")
|
||||||
@post2.replace!(replacement_url: "https://www.google.com/intl/en_ALL/images/logo.gif")
|
assert_equal("4ceadc314938bc27f3574053a3e1459a", @post1.md5)
|
||||||
|
assert_equal("cad1da177ef309bf40a117c17b8eecf5", @post2.md5)
|
||||||
|
@post2.reload
|
||||||
|
@post2.replace!(replacement_url: "https://raikou1.donmai.us/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg")
|
||||||
|
assert_equal("d34e4cf0a437a5d65f8e82b7bcd02606", @post2.md5)
|
||||||
Upload.destroy_all
|
Upload.destroy_all
|
||||||
|
@post1.reload
|
||||||
|
@post2.reload
|
||||||
@post1.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247364")
|
@post1.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247364")
|
||||||
@post2.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247350")
|
@post2.replace!(replacement_url: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247350")
|
||||||
|
assert_equal("cad1da177ef309bf40a117c17b8eecf5", @post1.md5)
|
||||||
|
assert_equal("4ceadc314938bc27f3574053a3e1459a", @post2.md5)
|
||||||
end
|
end
|
||||||
|
|
||||||
Timecop.travel(Time.now + PostReplacement::DELETION_GRACE_PERIOD + 1.day) do
|
Timecop.travel(Time.now + PostReplacement::DELETION_GRACE_PERIOD + 1.day) do
|
||||||
@@ -830,7 +838,7 @@ class UploadServiceTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
should "should fail validation" do
|
should "should fail validation" do
|
||||||
service = subject.new(file: upload_file("test/files/test-static-32x32.gif"))
|
service = subject.new(file: upload_file("test/files/test-large.jpg"))
|
||||||
upload = service.start!
|
upload = service.start!
|
||||||
assert_match(/image resolution is too large/, upload.status)
|
assert_match(/image resolution is too large/, upload.status)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user