fix tests
This commit is contained in:
@@ -191,7 +191,7 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
|
||||
context "when finding deviantart artists" do
|
||||
setup do
|
||||
skip "deviant art is not configured" unless Danbooru.config.deviantart_client_id.present?
|
||||
skip "DeviantArt API keys not set" unless Danbooru.config.deviantart_client_id.present?
|
||||
FactoryBot.create(:artist, :name => "artgerm", :url_string => "http://artgerm.deviantart.com/")
|
||||
FactoryBot.create(:artist, :name => "trixia", :url_string => "http://trixdraws.deviantart.com/")
|
||||
end
|
||||
|
||||
@@ -4,6 +4,8 @@ module Downloads
|
||||
class DeviantArtTest < ActiveSupport::TestCase
|
||||
context "a download for a deviant art html page" do
|
||||
setup do
|
||||
skip "DeviantArt API keys not set" unless Danbooru.config.deviantart_client_id.present?
|
||||
|
||||
@source = "http://starbitt.deviantart.com/art/09271X-636962118"
|
||||
@download = Downloads::File.new(@source)
|
||||
@tempfile = @download.download!
|
||||
|
||||
@@ -11,6 +11,7 @@ module Moderator
|
||||
@comment = FactoryBot.create(:comment)
|
||||
PoolArchive.stubs(:enabled?).returns(false)
|
||||
PostArchive.stubs(:enabled?).returns(false)
|
||||
@user.reload
|
||||
end
|
||||
|
||||
teardown do
|
||||
|
||||
@@ -73,19 +73,24 @@ class PoolTest < ActiveSupport::TestCase
|
||||
@p3 = FactoryBot.create(:post)
|
||||
CurrentUser.scoped(@user, "1.2.3.4") do
|
||||
@pool.add!(@p1)
|
||||
@pool.reload
|
||||
end
|
||||
CurrentUser.scoped(@user, "1.2.3.5") do
|
||||
@pool.add!(@p2)
|
||||
@pool.reload
|
||||
end
|
||||
CurrentUser.scoped(@user, "1.2.3.6") do
|
||||
@pool.add!(@p3)
|
||||
@pool.reload
|
||||
end
|
||||
CurrentUser.scoped(@user, "1.2.3.7") do
|
||||
@pool.remove!(@p1)
|
||||
@pool.reload
|
||||
end
|
||||
CurrentUser.scoped(@user, "1.2.3.8") do
|
||||
version = @pool.versions[1]
|
||||
@pool.revert_to!(version)
|
||||
@pool.reload
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@ require 'test_helper'
|
||||
|
||||
module Sources
|
||||
class DeviantArtTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
super
|
||||
skip "DeviantArt API keys not set" unless Danbooru.config.deviantart_client_id.present?
|
||||
end
|
||||
|
||||
context "The source for a private DeviantArt image URL" do
|
||||
setup do
|
||||
@site = Sources::Site.new("https://pre00.deviantart.net/423b/th/pre/i/2017/281/e/0/mindflayer_girl01_by_nickbeja-dbpxdt8.png")
|
||||
|
||||
Reference in New Issue
Block a user