refactored search
This commit is contained in:
@@ -3,6 +3,7 @@ require 'test_helper'
|
||||
class AdvertisementTest < ActiveSupport::TestCase
|
||||
context "An advertisement" do
|
||||
setup do
|
||||
Danbooru.config.stubs(:advertisement_path).returns("/tmp")
|
||||
@ad = FactoryGirl.create(:advertisement, :file => upload_jpeg("#{Rails.root}/test/files/test.jpg"))
|
||||
end
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
yuu = FactoryGirl.create(:artist, :name => "yuu", :group_name => "cat_or_fish")
|
||||
cat_or_fish.reload
|
||||
assert_equal("yuu", cat_or_fish.member_names)
|
||||
assert_not_nil(Artist.search(:group_name_contains => "cat_or_fish").first)
|
||||
assert_not_nil(Artist.search(:name => "group:cat_or_fish").first)
|
||||
end
|
||||
|
||||
should "have an associated wiki" do
|
||||
|
||||
@@ -27,7 +27,7 @@ module Sources
|
||||
first_tag = @site.tags.first
|
||||
assert_equal(2, first_tag.size)
|
||||
assert(first_tag[0] =~ /./)
|
||||
assert(first_tag[1] =~ /tags\.php\?tag=/)
|
||||
assert(first_tag[1] =~ /search\.php/)
|
||||
end
|
||||
|
||||
should "convert a page into a json representation" do
|
||||
|
||||
@@ -7,11 +7,13 @@ class UploadTest < ActiveSupport::TestCase
|
||||
CurrentUser.user = user
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
MEMCACHE.flush_all
|
||||
Delayed::Worker.delay_jobs = false
|
||||
end
|
||||
|
||||
teardown do
|
||||
CurrentUser.user = nil
|
||||
CurrentUser.ip_addr = nil
|
||||
Delayed::Worker.delay_jobs = true
|
||||
|
||||
@upload.delete_temp_file if @upload
|
||||
end
|
||||
@@ -122,7 +124,7 @@ class UploadTest < ActiveSupport::TestCase
|
||||
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
|
||||
assert_equal(6197, File.size(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
|
||||
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
|
||||
assert_equal(117877, File.size(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
|
||||
assert_equal(108224, File.size(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user