This commit is contained in:
r888888888
2015-05-21 15:05:55 -07:00
parent af86099ac5
commit 2ddc93723c
17 changed files with 3156 additions and 3554 deletions

View File

@@ -79,6 +79,11 @@ module Sources
assert_contains(pixiv_links, /search\.php/)
end
should "get the artist commentary" do
assert_not_nil(@site.artist_commentary_title)
assert_not_nil(@site.artist_commentary_desc)
end
should "convert a page into a json representation" do
assert_nothing_raised do
@site.to_json

View File

@@ -44,6 +44,10 @@ module Sources
assert_equal([], @site.tags)
end
should "get the artist commentary" do
assert_not_nil(@site.artist_commentary_desc)
end
should "convert a page into a json representation" do
assert_nothing_raised do
@site.to_json

View File

@@ -217,6 +217,27 @@ class UploadTest < ActiveSupport::TestCase
end
end
context "with an artist commentary" do
setup do
@upload = FactoryGirl.create(:source_upload,
:rating => "s",
:uploader_ip_addr => "127.0.0.1",
:tag_string => "hoge foo"
)
@upload.include_artist_commentary = "1"
@upload.artist_commentary_title = ""
@upload.artist_commentary_desc = "blah"
end
should "create an artist commentary when processed" do
VCR.use_cassette("upload-test-file", :record => :none) do
assert_difference("ArtistCommentary.count") do
@upload.process!
end
end
end
end
should "process completely for a downloaded image" do
@upload = FactoryGirl.create(:source_upload,
:rating => "s",