From cc781ba2b9dec3b8154dab1bd45adc71277eade1 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 5 Dec 2020 12:54:32 -0600 Subject: [PATCH] tests: add tests for #4551, #4630. --- test/unit/artist_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/artist_test.rb b/test/unit/artist_test.rb index 7fcc08e9d..3650b05af 100644 --- a/test/unit/artist_test.rb +++ b/test/unit/artist_test.rb @@ -363,6 +363,20 @@ class ArtistTest < ActiveSupport::TestCase end end + context "when finding fc2.com artists" do + setup do + create(:artist, name: "awa", url_string: "http://abk00.blog.fc2.com") + end + + should "find the artist" do + assert_artist_found("awa", "http://blog71.fc2.com/a/abk00/file/20080220194219.jpg") + end + + should "return nothing for an unknown artist" do + assert_artist_not_found("http://blog71.fc2.com/a/nobody/file/20080220194219.jpg") + end + end + should "normalize its other names" do artist = FactoryBot.create(:artist, name: "a1", other_names: "a1 aaa aaa AAA bbb ccc_ddd") assert_equal("aaa bbb ccc_ddd", artist.other_names_string)