From 6ac0a46120cd3f9d36f755194438a050e18f6811 Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Thu, 29 Sep 2011 18:04:16 -0700 Subject: [PATCH] green jasmine by stubbing ajax_stream? in aspects controller --- app/views/aspects/_aspect_stream.haml | 2 +- app/views/aspects/index.html.haml | 2 +- lib/aspect_stream.rb | 4 ++++ spec/controllers/aspects_controller_spec.rb | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index fbd506ae6..29a6ccd5e 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -23,7 +23,7 @@ = render 'aspects/no_contacts_message' #main_stream.stream{:data => {:guids => stream.aspect_ids.join(',')}} - - if defined?(no_posts) && no_posts + - if stream.ajax_stream? #pagination =link_to(t('more'), next_page_path(:ajax_stream => true), :class => 'paginate') diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 4ba3eea39..d2b59a43f 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -26,7 +26,7 @@ .span-13.append-1 #aspect_stream_container.stream_container - = render 'aspects/aspect_stream', :stream => @stream, :no_posts => true + = render 'aspects/aspect_stream', :stream => @stream .span-5.rightBar.last = render 'aspects/selected_contacts', :stream => @stream diff --git a/lib/aspect_stream.rb b/lib/aspect_stream.rb index 4d5ea5be5..88e86190c 100644 --- a/lib/aspect_stream.rb +++ b/lib/aspect_stream.rb @@ -63,6 +63,10 @@ class AspectStream end end + def ajax_stream? + true + end + # Determine whether or not the stream is displaying across # all of the user's aspects. # diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index e668fe1b2..a46be3693 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -67,6 +67,9 @@ describe AspectsController do describe "#index" 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 get :index save_fixture(html_for("body"), "aspects_index")