tests: fix test failures when running without API keys.

Fix the test suite failing when trying to run it in the default state
with no config file or API keys configured. Most source sites require
API keys or login credentials to be set in order to work. Skip these
tests when credentials aren't configured.
This commit is contained in:
evazion
2021-09-22 03:49:05 -05:00
parent 3a05b7e832
commit ac12efb636
12 changed files with 54 additions and 3 deletions

View File

@@ -2,6 +2,10 @@ require 'test_helper'
module Sources
class PixivTest < ActiveSupport::TestCase
setup do
skip "Pixiv credentials not configured" unless Sources::Strategies::Pixiv.enabled?
end
def assert_illust_id(illust_id, url)
site = Sources::Strategies.find(url)
assert_equal(illust_id, site.illust_id)