Permalink
Browse files

See, writing tests actually CAN help! Replace an instance var with th…

…e real var, so, you know, we invite them to the actual project
  • Loading branch information...
1 parent 585d3f5 commit febae24c638b725fef71bddf0e334a1858780c10 @courtenay courtenay committed May 15, 2009
Showing with 5 additions and 5 deletions.
  1. +5 −5 app/models/job/user_inviter.rb
@@ -1,13 +1,13 @@
class Job::UserInviter < Job::Base.new(:project, :user)
def perform
- case user.class
- when User
+ case user.class.name
+ when 'User'
User::Mailer.deliver_project_invitation project, user
- when Invitation
- User::Mailer.deliver_new_invitation @project, user
+ when 'Invitation'
+ User::Mailer.deliver_new_invitation project, user
else
- raise "Unsupported invitation type #{user.class.name}"
+ raise "Unsupported invitation type '#{user.class.name}'"
end
end

0 comments on commit febae24

Please sign in to comment.