green jasmine by stubbing ajax_stream? in aspects controller

This commit is contained in:
Maxwell Salzberg 2011-09-29 18:04:16 -07:00
parent 9760033fa5
commit 6ac0a46120
4 changed files with 9 additions and 2 deletions

View file

@ -23,7 +23,7 @@
= render 'aspects/no_contacts_message' = render 'aspects/no_contacts_message'
#main_stream.stream{:data => {:guids => stream.aspect_ids.join(',')}} #main_stream.stream{:data => {:guids => stream.aspect_ids.join(',')}}
- if defined?(no_posts) && no_posts - if stream.ajax_stream?
#pagination #pagination
=link_to(t('more'), next_page_path(:ajax_stream => true), :class => 'paginate') =link_to(t('more'), next_page_path(:ajax_stream => true), :class => 'paginate')

View file

@ -26,7 +26,7 @@
.span-13.append-1 .span-13.append-1
#aspect_stream_container.stream_container #aspect_stream_container.stream_container
= render 'aspects/aspect_stream', :stream => @stream, :no_posts => true = render 'aspects/aspect_stream', :stream => @stream
.span-5.rightBar.last .span-5.rightBar.last
= render 'aspects/selected_contacts', :stream => @stream = render 'aspects/selected_contacts', :stream => @stream

View file

@ -63,6 +63,10 @@ class AspectStream
end end
end end
def ajax_stream?
true
end
# Determine whether or not the stream is displaying across # Determine whether or not the stream is displaying across
# all of the user's aspects. # all of the user's aspects.
# #

View file

@ -67,6 +67,9 @@ describe AspectsController do
describe "#index" do describe "#index" do
context 'jasmine fixtures' do context 'jasmine fixtures' do
before do
AspectStream.any_instance.stub(:ajax_stream?).and_return(false)
end
it "generates a jasmine fixture", :fixture => true do it "generates a jasmine fixture", :fixture => true do
get :index get :index
save_fixture(html_for("body"), "aspects_index") save_fixture(html_for("body"), "aspects_index")