artists: factor out artist finder to separate module.

This commit is contained in:
evazion
2020-03-06 20:04:47 -06:00
parent a271ddcc29
commit ddffffb413
4 changed files with 145 additions and 144 deletions

View File

@@ -2,7 +2,7 @@ require 'test_helper'
class ArtistTest < ActiveSupport::TestCase
def assert_artist_found(expected_name, source_url)
artists = Artist.find_artists(source_url).to_a
artists = ArtistFinder.find_artists(source_url).to_a
assert_equal(1, artists.size)
assert_equal(expected_name, artists.first.name, "Testing URL: #{source_url}")
@@ -11,7 +11,7 @@ class ArtistTest < ActiveSupport::TestCase
end
def assert_artist_not_found(source_url)
artists = Artist.find_artists(source_url).to_a
artists = ArtistFinder.find_artists(source_url).to_a
assert_equal(0, artists.size, "Testing URL: #{source_url}")
rescue Net::OpenTimeout
skip "Remote connection failed for #{source_url}"