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,21 +2,23 @@ module AdvertisementsHelper
def render_advertisement(ad_type)
if Danbooru.config.can_see_ads?(CurrentUser.user)
@advertisement = Advertisement.find(:first, :conditions => ["ad_type = ? AND status = 'active'", ad_type], :order => "random()")
content_tag(
"div",
link_to(
image_tag(
@advertisement.image_url,
:alt => "Advertisement",
:width => @advertisement.width,
:height => @advertisement.height
),
advertisement_hits_path(:advertisement_id => @advertisement.id),
:remote => true,
:method => :post
),
:style => "margin-bottom: 1em;"
)
if @advertisement
content_tag(
"div",
link_to(
image_tag(
@advertisement.image_url,
:alt => "Advertisement",
:width => @advertisement.width,
:height => @advertisement.height
),
advertisement_hits_path(:advertisement_id => @advertisement.id),
:remote => true,
:method => :post
),
:style => "margin-bottom: 1em;"
)
end
else
""
end

View File

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

View File

@@ -76,7 +76,8 @@ class ForumPostsControllerTest < ActionController::TestCase
context "destroy action" 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))
@forum_post.reload
assert_equal(true, @forum_post.is_deleted?)