]> cat aescling's git repositories - mastodon.git/commit
Expand spec coverage and refactor the `Account.find_` methods (#3485)
authorMatt Jankowski <mjankowski@thoughtbot.com>
Wed, 31 May 2017 18:28:45 +0000 (14:28 -0400)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 31 May 2017 18:28:45 +0000 (20:28 +0200)
commit2cc3111a7775066c34eb407cd3b4707acc659488
tree64b3212472eb10df4b22709e4bf4b00e13ac8e47
parentbf811e4d4a8626579fc5187f465cdf1e79a32e10
Expand spec coverage and refactor the `Account.find_` methods (#3485)

* Move specs for account finder methods to concern spec

* Move account finder methods to concern

* Improve spec wording

* Use more explicit comparison to ensure correct return value

* Add coverage for .find_local! and .find_remote!

* Add some methods to the finder

* Use arel on matching_username method

* Avoid ternary in matching domain method

* Simplify finder methods

* Use an AccountFinder class to simplify lookup
app/models/account.rb
app/models/concerns/account_finder_concern.rb [new file with mode: 0644]
spec/models/account_spec.rb
spec/models/concerns/account_finder_concern_spec.rb [new file with mode: 0644]