refactored source code, work on pixiv integration

This commit is contained in:
albert
2011-09-26 16:47:22 -04:00
parent 11b623c66b
commit 284141aace
19 changed files with 201 additions and 45 deletions

View File

@@ -5,11 +5,12 @@ require 'test_helper'
class PixivProxyTest < ActiveSupport::TestCase
context "The proxy" do
should "get a single post" do
proxy = Sources::Site.new("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=9646484")
site = Sources::Site.new("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=9646484")
site.get
assert_equal("http://www.pixiv.net/member.php?id=4015", proxy.profile_url)
assert(proxy.tags.size > 0)
first_tag = proxy.tags.first
assert_equal("http://www.pixiv.net/member.php?id=4015", site.profile_url)
assert(site.tags.size > 0)
first_tag = site.tags.first
assert_equal(2, first_tag.size)
assert(first_tag[0] =~ /./)
assert(first_tag[1] =~ /tags\.php\?tag=/)