* Removed Pixa/Tinami sources

* Upgraded to Rails 3.2.3
* Fixed tests
This commit is contained in:
albert
2012-06-01 19:22:58 -04:00
parent 105cba5963
commit 17881068e1
124 changed files with 1063 additions and 1214 deletions

View File

@@ -1,39 +1,39 @@
# encoding: UTF-8
require 'test_helper'
module Sources
class PixaTest < ActiveSupport::TestCase
context "The source site for pixa" do
setup do
@site = Sources::Site.new("http://www.pixa.cc/illustrations/show/75575")
@site.get
end
should "get the profile" do
assert_equal("http://www.pixa.cc/profiles/show/9191", @site.profile_url)
end
should "get the artist name" do
assert_equal("air", @site.artist_name)
end
should "get the image url" do
assert_equal("http://file0.pixa.cc/illustrations/34/cb/df/70/49/b4/52/2d/42/c6/middle/110910魔法少女のコピー.jpg?1315664621", @site.image_url)
end
should "get the tags" do
assert(@site.tags.size > 0)
first_tag = @site.tags.first
assert_equal(2, first_tag.size)
assert(first_tag[0] =~ /./)
end
should "convert a page into a json representation" do
assert_nothing_raised do
@site.to_json
end
end
end
end
end
# # encoding: UTF-8
#
# require 'test_helper'
#
# module Sources
# class PixaTest < ActiveSupport::TestCase
# context "The source site for pixa" do
# setup do
# @site = Sources::Site.new("http://www.pixa.cc/illustrations/show/75575")
# @site.get
# end
#
# should "get the profile" do
# assert_equal("http://www.pixa.cc/profiles/show/9191", @site.profile_url)
# end
#
# should "get the artist name" do
# assert_equal("air", @site.artist_name)
# end
#
# should "get the image url" do
# assert_equal("http://file0.pixa.cc/illustrations/34/cb/df/70/49/b4/52/2d/42/c6/middle/110910魔法少女のコピー.jpg?1315664621", @site.image_url)
# end
#
# should "get the tags" do
# assert(@site.tags.size > 0)
# first_tag = @site.tags.first
# assert_equal(2, first_tag.size)
# assert(first_tag[0] =~ /./)
# end
#
# should "convert a page into a json representation" do
# assert_nothing_raised do
# @site.to_json
# end
# end
# end
# end
# end

View File

@@ -1,38 +1,38 @@
# encoding: UTF-8
require 'test_helper'
module Sources
class TinamiTest < ActiveSupport::TestCase
context "The source site for tinami" do
context "for tinami" do
setup do
@site = Sources::Site.new("http://www.tinami.com/view/308311")
@site.get
end
should "get the profile" do
assert_equal("http://www.tinami.com/creator/profile/29399", @site.profile_url)
end
should "get the artist name" do
assert_match(/ROM/, @site.artist_name)
end
should "get the image url" do
assert_equal("http://img.tinami.com/illust2/img/336/4e80b9773c084.png", @site.image_url)
end
should "get the tags" do
assert(@site.tags.size > 0)
end
should "convert a page into a json representation" do
assert_nothing_raised do
@site.to_json
end
end
end
end
end
end
# # encoding: UTF-8
#
# require 'test_helper'
#
# module Sources
# class TinamiTest < ActiveSupport::TestCase
# context "The source site for tinami" do
# context "for tinami" do
# setup do
# @site = Sources::Site.new("http://www.tinami.com/view/308311")
# @site.get
# end
#
# should "get the profile" do
# assert_equal("http://www.tinami.com/creator/profile/29399", @site.profile_url)
# end
#
# should "get the artist name" do
# assert_match(/ROM/, @site.artist_name)
# end
#
# should "get the image url" do
# assert_equal("http://img.tinami.com/illust2/img/336/4e80b9773c084.png", @site.image_url)
# end
#
# should "get the tags" do
# assert(@site.tags.size > 0)
# end
#
# should "convert a page into a json representation" do
# assert_nothing_raised do
# @site.to_json
# end
# end
# end
# end
# end
# end