Refactor UsersController#invited

* Add test coverage
* Simplify controller action
* Move finder code to Invite class
This commit is contained in:
Scott Albertson
2013-11-08 11:11:41 -08:00
parent e5fd2946e0
commit 77b59b54ce
5 changed files with 215 additions and 24 deletions

View File

@ -43,4 +43,10 @@ module Helpers
range = [*'a'..'z']
Array.new(length){range.sample}.join
end
def stub_guardian(user)
guardian = Guardian.new(user)
yield(guardian) if block_given?
Guardian.stubs(new: guardian).with(user)
end
end