Merge branch 'master' of github.com:r888888888/danbooru
This commit is contained in:
5653
test/fixtures/vcr_cassettes/download-pixiv-html.yml
vendored
Normal file
5653
test/fixtures/vcr_cassettes/download-pixiv-html.yml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
39721
test/fixtures/vcr_cassettes/download-pixiv-manga.yml
vendored
Normal file
39721
test/fixtures/vcr_cassettes/download-pixiv-manga.yml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4189
test/fixtures/vcr_cassettes/download-pixiv-small.yml
vendored
Normal file
4189
test/fixtures/vcr_cassettes/download-pixiv-small.yml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1472
test/fixtures/vcr_cassettes/source-pixiv-unit-test.yml
vendored
Normal file
1472
test/fixtures/vcr_cassettes/source-pixiv-unit-test.yml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -89,3 +89,9 @@ class MockMemcache
|
||||
end
|
||||
|
||||
MEMCACHE = MockMemcache.new
|
||||
|
||||
VCR.configure do |c|
|
||||
c.cassette_library_dir = "test/fixtures/vcr_cassettes"
|
||||
c.hook_into :webmock
|
||||
c.allow_http_connections_when_no_cassette = true
|
||||
end
|
||||
|
||||
@@ -7,7 +7,9 @@ module Downloads
|
||||
@source = "http://img65.pixiv.net/img/kiyoringo/21755794_p2.png"
|
||||
@tempfile = Tempfile.new("danbooru-test")
|
||||
@download = Downloads::File.new(@source, @tempfile.path)
|
||||
@download.download!
|
||||
VCR.use_cassette("download-pixiv-manga", :record => :new_episodes) do
|
||||
@download.download!
|
||||
end
|
||||
end
|
||||
|
||||
should "instead download the big version" do
|
||||
@@ -21,7 +23,9 @@ module Downloads
|
||||
@source = "http://www.pixiv.net/member_illust.php?mode=big&illust_id=4348318"
|
||||
@tempfile = Tempfile.new("danbooru-test")
|
||||
@download = Downloads::File.new(@source, @tempfile.path)
|
||||
@download.download!
|
||||
VCR.use_cassette("download-pixiv-html", :record => :new_episodes) do
|
||||
@download.download!
|
||||
end
|
||||
end
|
||||
|
||||
should "work" do
|
||||
@@ -34,7 +38,9 @@ module Downloads
|
||||
@source = "http://img02.pixiv.net/img/wanwandoh/4348318_m.jpg"
|
||||
@tempfile = Tempfile.new("danbooru-test")
|
||||
@download = Downloads::File.new(@source, @tempfile.path)
|
||||
@download.download!
|
||||
VCR.use_cassette("download-pixiv-small", :record => :new_episodes) do
|
||||
@download.download!
|
||||
end
|
||||
end
|
||||
|
||||
should "instead download the original version" do
|
||||
|
||||
@@ -6,8 +6,9 @@ module Sources
|
||||
class PixivTest < ActiveSupport::TestCase
|
||||
context "The source site for pixiv" do
|
||||
setup do
|
||||
@site = Sources::Site.new("http://www.pixiv.net/member_illust.php?mode=big&illust_id=9646484")
|
||||
@site.get
|
||||
VCR.use_cassette("source-pixiv-unit-test", :record => :new_episodes) do
|
||||
@site = Sources::Site.new("http://www.pixiv.net/member_illust.php?mode=big&illust_id=9646484")
|
||||
end
|
||||
end
|
||||
|
||||
should "get the profile" do
|
||||
|
||||
Reference in New Issue
Block a user