fixed tests
This commit is contained in:
@@ -111,8 +111,8 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "normalize its other names" do
|
||||
artist = FactoryGirl.create(:artist, :name => "a1", :other_names => "aaa, bbb, ccc ddd")
|
||||
assert_equal("aaa bbb ccc_ddd", artist.other_names)
|
||||
artist = FactoryGirl.create(:artist, :name => "a1", :other_names_comma => "aaa, bbb, ccc ddd")
|
||||
assert_equal("aaa, bbb, ccc_ddd", artist.other_names_comma)
|
||||
end
|
||||
|
||||
should "search on its name should return results" do
|
||||
@@ -121,7 +121,7 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "search on other names should return matches" do
|
||||
artist = FactoryGirl.create(:artist, :name => "artist", :other_names => "aaa, ccc ddd")
|
||||
artist = FactoryGirl.create(:artist, :name => "artist", :other_names_comma => "aaa, ccc ddd")
|
||||
assert_nil(Artist.other_names_match("artist").first)
|
||||
assert_not_nil(Artist.other_names_match("aaa").first)
|
||||
assert_not_nil(Artist.other_names_match("ccc_ddd").first)
|
||||
|
||||
@@ -183,7 +183,7 @@ class PoolTest < ActiveSupport::TestCase
|
||||
|
||||
should "normalize its name" do
|
||||
@pool.update_attributes(:name => "A B")
|
||||
assert_equal("a_b", @pool.name)
|
||||
assert_equal("A_B", @pool.name)
|
||||
end
|
||||
|
||||
should "normalize its post ids" do
|
||||
|
||||
@@ -38,6 +38,10 @@ class PostTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
context "Deleting a post" do
|
||||
setup do
|
||||
Danbooru.config.stubs(:blank_tag_search_fast_count).returns(nil)
|
||||
end
|
||||
|
||||
context "that is status locked" do
|
||||
setup do
|
||||
@post = FactoryGirl.create(:post)
|
||||
@@ -862,6 +866,10 @@ class PostTest < ActiveSupport::TestCase
|
||||
|
||||
context "Counting:" do
|
||||
context "Creating a post" do
|
||||
setup do
|
||||
Danbooru.config.stubs(:blank_tag_search_fast_count).returns(nil)
|
||||
end
|
||||
|
||||
should "increment the post count" do
|
||||
assert_equal(0, Post.fast_count(""))
|
||||
post = FactoryGirl.create(:post, :tag_string => "aaa bbb")
|
||||
|
||||
Reference in New Issue
Block a user