aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/models/question_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb
index a0026ec..05e81ef 100644
--- a/spec/models/question_spec.rb
+++ b/spec/models/question_spec.rb
@@ -182,4 +182,14 @@ describe Question do
Factory(:question, :user => Factory(:administrator)).approved.should be_true
Factory(:question, :user => nil).approved.should be_true
end
+
+ it "should properly recognize if it's answered" do
+ q = Factory(:question)
+ u = Factory(:recruit)
+ q.answered?(u).should be_false
+ Factory(:answer, :question => q)
+ q.answered?(u).should be_false
+ Factory(:answer, :question => q, :owner=> u)
+ q.answered?(u).should be_true
+ end
end