From 7b29eb3695bc1f3ae62e2faa49452bdf11da2a51 Mon Sep 17 00:00:00 2001 From: Joachim Filip Ignacy Bartosik Date: Fri, 13 Aug 2010 11:03:06 +0200 Subject: Improve coverage of Question model --- spec/models/question_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit v1.2.3-65-gdbad