Merge branch 'circleci-fixes'

This commit is contained in:
Albert Yi
2018-05-15 10:25:06 -07:00
11 changed files with 168 additions and 86 deletions

View File

@@ -4,6 +4,11 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
def assert_artist_found(expected_artist, source_url = nil)
if source_url
get_auth finder_artists_path(format: "json", url: source_url), @user
puts response.body
if response.body =~ /Net::OpenTimeout/
skip "Remote connection to #{source_url} failed"
return
end
end
assert_response :success
json = JSON.parse(response.body)
@@ -12,7 +17,14 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
end
def assert_artist_not_found(source_url)
tries = 0
get_auth finder_artists_path(format: "json", url: source_url), @user
if response.body =~ /Net::OpenTimeout/
skip "Remote connection to #{source_url} failed"
return
end
assert_response :success
json = JSON.parse(response.body)
assert_equal(0, json.size, "Testing URL: #{source_url}")

View File

@@ -4,8 +4,12 @@ class SourcesControllerTest < ActionDispatch::IntegrationTest
context "The sources controller" do
context "show action" do
should "work for a pixiv URL" do
get source_path, params: { url: "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=14901720", format: "json" }
assert_response :success
begin
get source_path, params: { url: "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=14901720", format: "json" }
assert_response :success
rescue Net::OpenTimeout
skip "Remote connection failed to Pixiv failed"
end
end
should "work for a direct twitter URL with referer" do