mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
Refactor UsersController#invited
* Add test coverage * Simplify controller action * Move finder code to Invite class
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user