aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-08-13 11:03:06 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-08-14 13:15:32 +0200
commit7b29eb3695bc1f3ae62e2faa49452bdf11da2a51 (patch)
tree670b4c5994cc8d89220dc1bd3f5de619c0e976ed
parentImprove coverage of UserMailer model (diff)
downloadrecruiting-webapp-7b29eb3695bc1f3ae62e2faa49452bdf11da2a51.tar.gz
recruiting-webapp-7b29eb3695bc1f3ae62e2faa49452bdf11da2a51.tar.bz2
recruiting-webapp-7b29eb3695bc1f3ae62e2faa49452bdf11da2a51.zip
Improve coverage of Question model
-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