From cd2eb4292e0b6b9a5ba9ce6e14b7f9e3bf2e6fd5 Mon Sep 17 00:00:00 2001
From: Maxwell Salzberg <maxwell@joindiaspora.com>
Date: Thu, 29 Sep 2011 17:23:53 -0700
Subject: [PATCH] fix cuke for inf scroll(dont rely on session for sort order)

---
 app/helpers/stream_helper.rb     | 2 +-
 features/infinite_scroll.feature | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb
index e84694c736..f747e5fe8d 100644
--- a/app/helpers/stream_helper.rb
+++ b/app/helpers/stream_helper.rb
@@ -19,7 +19,7 @@ module StreamHelper
      else
        time = @stream.posts.last.send(@stream.order.to_sym).to_i
      end
-      aspects_path(:max_time => time, :a_ids => @stream.aspect_ids)
+      aspects_path(:max_time => time, :sort_order => session[:sort_order], :a_ids => @stream.aspect_ids)
     else
       raise 'in order to use pagination for this new controller, update next_page_path in stream helper'
     end
diff --git a/features/infinite_scroll.feature b/features/infinite_scroll.feature
index d928b459dc..ea48f6b8d0 100644
--- a/features/infinite_scroll.feature
+++ b/features/infinite_scroll.feature
@@ -8,6 +8,7 @@ Feature: infinite scroll
       Given many posts from alice for bob
       And I resize my window to 800x600
       And I sign in as "bob@bob.bob"
+      And I wait for the ajax to finish
 
     Scenario: on the main stream by activity
       Then I should see 15 posts
@@ -25,7 +26,6 @@ Feature: infinite scroll
       Then I should see "No more"
 
       When I follow "generic"
-      And I wait for the ajax to finish
       Then I should see 15 posts
       And I should see "alice - 26 - #seeded"
 
@@ -41,8 +41,8 @@ Feature: infinite scroll
       Then I should see "No more"
 
     Scenario: on the main stream post created time
-      When I wait for the ajax to finish
       And I follow "posted"
+      And I go to the home page
       Then I should see 15 posts
       And I should see "alice - 15 - #seeded"
 
-- 
GitLab