fixed jrails, fixed deprecation warnings
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
|
||||
require 'factory_girl'
|
||||
require 'shoulda'
|
||||
require 'mocha'
|
||||
require 'faker'
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
|
||||
|
||||
23
test/unit/pixiv_proxy_test.rb
Normal file
23
test/unit/pixiv_proxy_test.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
require_relative '../test_helper'
|
||||
|
||||
class PixivProxyTest < ActiveSupport::TestCase
|
||||
context "The proxy" do
|
||||
should "get the profile" do
|
||||
results = PixivProxy.get_profile("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=9646484")
|
||||
assert_equal("シビレ\347\275\240", results[:artist])
|
||||
assert_equal("/member_illust.php?id=9646484", results[:listing_url])
|
||||
end
|
||||
|
||||
should "get a single post" do
|
||||
results = PixivProxy.get_single("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=9646484")
|
||||
assert_equal("/member.php?id=4015", results[:profile_url])
|
||||
assert(results[:jp_tags].size > 0)
|
||||
first_tag = results[:jp_tags][0]
|
||||
assert_equal(2, first_tag.size)
|
||||
assert(first_tag[0] =~ /./)
|
||||
assert(first_tag[1] =~ /tags\.php\?tag=/)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user