diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-07-09 11:23:45 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2010-07-12 19:17:19 +0200 |
commit | ffe828d2686442a8546e1740c157beb57c9e420f (patch) | |
tree | f3cb8ed87af69fcc41c9fdb3838de97dba471998 /spec | |
parent | Multiple choice questions (diff) | |
download | recruiting-webapp-ffe828d2686442a8546e1740c157beb57c9e420f.tar.gz recruiting-webapp-ffe828d2686442a8546e1740c157beb57c9e420f.tar.bz2 recruiting-webapp-ffe828d2686442a8546e1740c157beb57c9e420f.zip |
Bug fix - answer was trying to send notifications to non-existing mentors
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/answer_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/models/answer_spec.rb b/spec/models/answer_spec.rb index f3778f8..4a5c5cd 100644 --- a/spec/models/answer_spec.rb +++ b/spec/models/answer_spec.rb @@ -52,7 +52,7 @@ describe Answer do view_denied(fabricate_users(:recruit, :mentor)+ [Guest.new], new_answer) end end - + it 'should be allowed for recruiters to view all answers' do for user in fabricate_all_roles new_answer = Answer.new(:owner => user) @@ -152,4 +152,13 @@ describe Answer do answer.content = "changed" answer.save! end + + it "shouldn't try to send notifications to mentor of mentorless recruit" do + recruit = Factory(:recruit, :mentor => nil) + answer = Answer.new, :owner => recruit, :content => "example", :question => Factory(:question) + UserMailer.should_not_receive(:deliver_changed_answer) + answer.save! + answer.content = "changed" + answer.save! + end end |