fix tests

This commit is contained in:
albert
2013-02-18 20:59:45 -05:00
parent 8a46836238
commit e3ddafa265
3 changed files with 19 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ module AdvertisementsHelper
def render_advertisement(ad_type) def render_advertisement(ad_type)
if Danbooru.config.can_see_ads?(CurrentUser.user) if Danbooru.config.can_see_ads?(CurrentUser.user)
@advertisement = Advertisement.find(:first, :conditions => ["ad_type = ? AND status = 'active'", ad_type], :order => "random()") @advertisement = Advertisement.find(:first, :conditions => ["ad_type = ? AND status = 'active'", ad_type], :order => "random()")
if @advertisement
content_tag( content_tag(
"div", "div",
link_to( link_to(
@@ -17,6 +18,7 @@ module AdvertisementsHelper
), ),
:style => "margin-bottom: 1em;" :style => "margin-bottom: 1em;"
) )
end
else else
"" ""
end end

View File

@@ -7,7 +7,6 @@
class TagSetPresenter < Presenter class TagSetPresenter < Presenter
def initialize(tags) def initialize(tags)
@tags = tags @tags = tags
puts @tags.inspect
end end
def tag_list_html(template, options = {}) def tag_list_html(template, options = {})

View File

@@ -76,7 +76,8 @@ class ForumPostsControllerTest < ActionController::TestCase
context "destroy action" do context "destroy action" do
should "destroy the posts" do should "destroy the posts" do
post :destroy, {:id => @forum_post.id}, {:user_id => @user.id} CurrentUser.user = @mod
post :destroy, {:id => @forum_post.id}, {:user_id => @mod.id}
assert_redirected_to(forum_post_path(@forum_post)) assert_redirected_to(forum_post_path(@forum_post))
@forum_post.reload @forum_post.reload
assert_equal(true, @forum_post.is_deleted?) assert_equal(true, @forum_post.is_deleted?)