Browse files

Fixed FUQ issue for not logged in users.

  • Loading branch information...
2 parents 7a9019b + 6bd294f commit c83b35fce2f09244b1c9f2482e85a969926fa9ca @laszlopapp committed Mar 10, 2011
Showing with 22 additions and 16 deletions.
  1. +1 −1 app/models/statements/follow_up_question.rb
  2. +21 −15 features/discuss.feature
View
2 app/models/statements/follow_up_question.rb
@@ -50,7 +50,7 @@ def children_conditions(parent_id, types = nil, user = nil)
parent = StatementNode.find(parent_id)
conditions = ""
conditions << sanitize_sql(["(statements.editorial_state_id = ? OR statement_nodes.creator_id = ?) AND ",
- StatementState['published'].id, user.id]) if user
+ StatementState['published'].id, user ? user.id : -1])
conditions << sanitize_sql(["statement_nodes.type = ? AND
statement_nodes.root_id = ? AND
statement_nodes.lft >= ? AND statement_nodes.rgt <= ? ",
View
36 features/discuss.feature
@@ -62,9 +62,9 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "Improving the unimprovable"
And the proposal should have one improvement
-
+
# TEST THE 'ADD NEW' SECTION
-
+
@ok
Scenario: Add a sibling question
Given I am logged in as "user" with password "true"
@@ -78,7 +78,7 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "Question on the side"
And the question should have 5 siblings in session
-
+
Scenario: Add a sibling Proposal
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -93,8 +93,8 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "How to propose to women"
And the proposal should have 1 siblings in session
-
- Scenario: Add a sibling Improvement
+
+ Scenario: Add a sibling Improvement
Given I am logged in as "user" with password "true"
And I am on the discuss index
When I follow "Featured"
@@ -109,7 +109,7 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "How to improve yer status"
And the improvement should have 5 siblings in session
-
+
Scenario: Add a Proposal to a Question
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -123,7 +123,7 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "How to propose to women"
And the proposal should have 1 siblings in session
-
+
Scenario: Add an Improvement to a proposal
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -138,7 +138,7 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "How to improve yer status"
And the improvement should have 5 siblings in session
-
+
Scenario: Add a Pro Argument to a proposal
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -153,7 +153,7 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "Pro 4 life"
And the pro argument should have 0 siblings in session
-
+
Scenario: Add a Pro Argument to a proposal
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -168,7 +168,7 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "Contra is cool"
And the contra argument should have 0 siblings in session
-
+
Scenario: Add a Follow Up Question to a Question
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -183,7 +183,13 @@ Feature: Take Part on a question
Then I should see "Livin it up"
And the question should have 0 siblings in session
And there should be a "Test Question2?" breadcrumb
-
+ Given I go to the question
+ Then I should see "Livin it up"
+ Given I follow "Logout"
+ Then I should not see "Livin it up"
+ Given I login as "ben" with password "benrocks"
+ Then I should not see "Livin it up"
+
Scenario: Add a Follow Up Question to a Proposal
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -199,7 +205,7 @@ Feature: Take Part on a question
Then I should see "Livin it up"
And the question should have 0 siblings in session
And there should be a "A first proposal!" breadcrumb
-
+
Scenario: Add a Follow Up Question to an Improvement
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -216,7 +222,7 @@ Feature: Take Part on a question
Then I should see "Livin it up"
And the question should have 0 siblings in session
And there should be a "A better first proposal" breadcrumb
-
+
Scenario: Add a Follow Up Question to an Improvement, then a Follow Up Question to that question
Given I am logged in as "user" with password "true"
And I am on the discuss index
@@ -240,8 +246,8 @@ Feature: Take Part on a question
And I press "Save"
Then I should see "Livin it up Part Deux"
And the question should have 0 siblings in session
-
-
+
+
@ok
Scenario: Edit a proposal i created

0 comments on commit c83b35f

Please sign in to comment.