fixed tests
This commit is contained in:
@@ -44,9 +44,9 @@ class ArtistsControllerTest < ActionController::TestCase
|
||||
|
||||
should "update an artist" do
|
||||
post :update, {:id => @artist.id, :artist => {:name => "xxx"}}, {:user_id => @user.id}
|
||||
artist = Artist.last
|
||||
assert_equal("xxx", artist.name)
|
||||
assert_redirected_to(artist_path(artist))
|
||||
@artist.reload
|
||||
assert_equal("xxx", @artist.name)
|
||||
assert_redirected_to(artist_path(@artist))
|
||||
end
|
||||
|
||||
should "revert an artist" do
|
||||
|
||||
@@ -48,7 +48,7 @@ class IpBansControllerTest < ActionController::TestCase
|
||||
|
||||
should "destroy an ip ban" do
|
||||
assert_difference("IpBan.count", -1) do
|
||||
post :destroy, {:id => @ip_ban.id}, {:user_id => @admin.id}
|
||||
post :destroy, {:id => @ip_ban.id, :format => "js"}, {:user_id => @admin.id}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,8 +18,7 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@post = Factory.create(:post, :tag_string => "aaa")
|
||||
@artist = Factory.create(:artist, :name => "aaa")
|
||||
@artist.reload
|
||||
@artist.update_attributes(:is_banned => true, :as => :admin)
|
||||
@artist.update_attributes({:is_banned => true}, :as => :admin)
|
||||
@post.reload
|
||||
end
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ class PoolTest < ActiveSupport::TestCase
|
||||
|
||||
context "A name" do
|
||||
setup do
|
||||
@pool = Factory.create(:pool)
|
||||
@pool = Factory.create(:pool, :name => "xxx")
|
||||
end
|
||||
|
||||
should "be mapped to a pool id" do
|
||||
assert_equal(@pool.id, Pool.name_to_id(@pool.name))
|
||||
assert_equal(@pool.id, Pool.name_to_id("xxx"))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -584,9 +584,9 @@ class PostTest < ActiveSupport::TestCase
|
||||
post1 = Factory.create(:post)
|
||||
post2 = Factory.create(:post)
|
||||
post3 = Factory.create(:post)
|
||||
pool = Factory.create(:pool)
|
||||
pool = Factory.create(:pool, :name => "xxx")
|
||||
post1.add_pool!(pool)
|
||||
relation = Post.tag_match("pool:#{pool.name}")
|
||||
relation = Post.tag_match("pool:xxx")
|
||||
assert_equal(1, relation.count)
|
||||
assert_equal(post1.id, relation.first.id)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user