fix tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
class TagSetPresenter < Presenter
|
||||
def initialize(tags)
|
||||
@tags = tags
|
||||
puts @tags.inspect
|
||||
end
|
||||
|
||||
def tag_list_html(template, options = {})
|
||||
|
||||
@@ -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?)
|
||||
|
||||
Reference in New Issue
Block a user