From ea0240d6f8b0644b0a514dfe5659efb0e9300669 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Sat, 15 Oct 2011 21:08:22 -0700 Subject: [PATCH] fix broken mobile tag view --- app/views/shared/_stream_element.mobile.haml | 12 ++++++------ app/views/tags/show.mobile.haml | 6 +++--- spec/controllers/tags_controller_spec.rb | 5 +++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/views/shared/_stream_element.mobile.haml b/app/views/shared/_stream_element.mobile.haml index 666591b90..d0d1df44f 100644 --- a/app/views/shared/_stream_element.mobile.haml +++ b/app/views/shared/_stream_element.mobile.haml @@ -26,19 +26,19 @@ - if defined?(expanded_info) && expanded_info .comment_container .post_stats - - if @post.public? + - if post.public? %span.comment_count - = @post.reshares.size + = post.reshares.size %span.comment_count - = @post.comments.size + = post.comments.size %span.like_count - = @post.likes.size + = post.likes.size %ul.comments - = render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post} + = render :partial => 'comments/comment', :collection => @comments, :locals => {:post => post} %li.comment.add_comment_bottom_link_container - = link_to "Add a comment", new_post_comment_path(@post), :class => 'add_comment_bottom_link btn comment_action inactive' + = link_to "Add a comment", new_post_comment_path(post), :class => 'add_comment_bottom_link btn comment_action inactive' diff --git a/app/views/tags/show.mobile.haml b/app/views/tags/show.mobile.haml index 2e2ced94c..d87643c3d 100644 --- a/app/views/tags/show.mobile.haml +++ b/app/views/tags/show.mobile.haml @@ -3,11 +3,11 @@ -# the COPYRIGHT file. %h1 - = "##{params[:name]}" + = @stream.display_tag_name #main_stream.stream - = render 'shared/stream', :posts => @posts - -if @posts.length > 0 + = render 'shared/stream', :posts => @stream.posts + -if @stream.posts.length > 0 #pagination %a.more-link.paginate{:href => next_page_path} %h1 diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb index 69c128c1b..fcce6b312 100644 --- a/spec/controllers/tags_controller_spec.rb +++ b/spec/controllers/tags_controller_spec.rb @@ -62,6 +62,11 @@ describe TagsController do get :show, :name => 'hellyes' response.status.should == 200 end + + it 'succeeds with mobile' do + get :show, :name => 'foo', :format => :mobile + response.should be_success + end end end