... end def meta ... end def description ... end end <li class="search-result"> {{link}} {{popularity}} <div class="..."> {{meta}} </div> <div class="..."> {{description}} </div> </li>
@post.comments_enabled? && can?(:comment, @post) render 'comment_form', post: @post else content_tag :p, t(".comments_disabled") end end def comment_count if comments.count == 0 t(".no_comments") else t(".comment_count", count: comments.count) end end ... end
note for moderators" do presenter = UserPresenter.new(context, user: user) presenter.name.should == "John (moderator)" end end end Unit testing presenters