Commit Graph

106 Commits (36ccdcc9e12d35399742cbe05c2589d69dbbbc99)

Author SHA1 Message Date
Adam Niedzielski 337a7fcf30
Fix ß bug in regexp for mentions and tags (#31122) 5 months ago
Matt Jankowski 6e4305de69
Fix spec descriptions around configurable limit values (#31079) 5 months ago
kyori19 3a00f89aa1
Respect `Account::DISPLAY_NAME_LENGTH_LIMIT` in account spec correctly (#31075) 6 months ago
Matt Jankowski 91ef4a6fc5
Add assertion about key columns to account key generate spec (#30635) 6 months ago
Matt Jankowski 92b3004bf3
Reference constants from account validation specs (#30634) 7 months ago
Matt Jankowski 6262ceeb70
Fix `RSpec/DescribedClass` cop (#29472) 10 months ago
Matt Jankowski c09b8a7164
Add `Account.without_internal` scope (#29559)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
10 months ago
Matt Jankowski 245064bb98
Move "everyone" role and "instance actor" account magic number IDs to constants (#29260) 11 months ago
Matt Jankowski 95da28d201
Add common `ThreadingHelper` module for specs (#29116) 11 months ago
Matt Jankowski 18004bf227
Add `Account.matches_uri_prefix` scope and use in activitypub/followers_synchronizations controller (#28820) 12 months ago
Matt Jankowski 1480573c83
Add `Account.auditable` scope, fix N+1 in admin/action_logs#index (#28812) 12 months ago
Matt Jankowski 07e10e3747
Combine assertions about same setup in `Account#suspend!` spec (#28787) 12 months ago
Matt Jankowski cd37048439
Move followable_by coverage to suggestions (#28697) 12 months ago
Matt Jankowski 8b26614fa7
Combine results include check in spec/models/account (#28471) 12 months ago
Matt Jankowski 0a7cff53c2
Add coverage for `Account.followable_by` scope (#28689) 12 months ago
Matt Jankowski c753b1ad35
Clean up of `RSpec/LetSetup` within `spec/models` (#28444) 1 year ago
Matt Jankowski 440b80b2e7
Model concerns organization into module namespaces (#28149) 1 year ago
Matt Jankowski d2aacea8da
Reduce `.times` usage in AccountSearch spec, use constant for default limit (#27946) 1 year ago
Matt Jankowski b2c5b20ef2
Fix `RSpec/AnyInstance` cop (#27810) 1 year ago
Matt Jankowski bcd0171e5e
Fix `Lint/UselessAssignment` cop (#27472) 1 year ago
Matt Jankowski a1b27d8b61
Fix `Naming/VariableNumber` cop (#27447) 1 year ago
Matt Jankowski c676bc91e9
Dont match mention in url query string (#25656)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
1 year ago
Claire 1e3b19230a
Add stricter protocol fields validation for accounts (#25937) 1 year ago
Matt Jankowski c75df62ccc
Fix `RSpec/SubjectDeclaration` cop (#25312) 1 year ago
Matt Jankowski 6c0e3f490a
Fix RSpec/MissingExampleGroupArgument cop (#25310) 2 years ago
Matt Jankowski c42591356d
Fix `RSpec/DescribedClass` cop (#25104) 2 years ago
Nick Schonning 99e2e9b81f
Fix minor typos in comments and spec names (#21831) 2 years ago
Matt Jankowski c97b611b6b
Fix RSpec/InferredSpecType cop (#24736) 2 years ago
Matt Jankowski 710745e16b
Fix RSpec/ContextWording cop (#24739) 2 years ago
Matt Jankowski 570079f8ce
Fix Performance/TimesMap cop (#24789) 2 years ago
Matt Jankowski 274d561430
Enable local account key generation spec (#24728) 2 years ago
Nick Schonning a3393d0d07
Autofix Rubocop RSpec/MatchArray (#24050) 2 years ago
Matt Jankowski cd99fa8ceb
Fabricator specs (#23925) 2 years ago
Nick Schonning 84cc805cae
Enable Style/FrozenStringLiteralComment for specs (#23790) 2 years ago
Nick Schonning 5116347eb7
Autofix Rubocop RSpec/BeEq (#23740) 2 years ago
Nick Schonning bf785df9fe
Audofix Rubocop Style/WordArray (#23739) 2 years ago
Nick Schonning 4552685f6b
Autofix Rubocop RSpec/LeadingSubject (#23670) 2 years ago
Nick Schonning 65ba0d92ef
Enable Rubocop RSpec/NotToNot (#23723) 2 years ago
Nick Schonning 81ad6c2e39
Autofix Rubocop Style/StringLiterals (#23695) 2 years ago
Nick Schonning 3680e032b4
Autofix Rubocop RSpec/EmptyLineAfterFinalLet (#23707) 2 years ago
Claire 70415714f1
Add follow request banner on account header (#20785)
* Add requested_by to relationship maps

* Display whether an account has requested to follow you on their profile
2 years ago
Jeong Arm d412147d02
Save avatar or header correctly even if other one fails (#18465)
* Save avatar or header correctly if other one fails

* Fix test
2 years ago
luzpaz 6ba52306f9
Fix typos (#19849)
Found via `codespell -q 3 -S ./yarn.lock,./CHANGELOG.md,./AUTHORS.md,./config/locales,./app/javascript/mastodon/locales -L ba,followings,keypair,medias,pattens,pixelx,rememberable,ro,te`
2 years ago
Roni Laukkarinen 36b0ff57b7
Fix grammar (#20106) 2 years ago
Eugen Rochko 44b2ee3485
Add customizable user roles (#18641)
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
3 years ago
Claire 440eb71310
Change unapproved and unconfirmed account to not be accessible in the REST API (#17530)
* Change unapproved and unconfirmed account to not be accessible in the REST API

* Change Account#searchable? to reject unconfirmed and unapproved users

* Disable search for unapproved and unconfirmed users in Account.search_for

* Disable search for unapproved and unconfirmed users in Account.advanced_search_for

* Remove unconfirmed and unapproved accounts from Account.searchable scope

* Prevent mentions to unapproved/unconfirmed accounts

* Fix some old tests for Account.advanced_search_for

* Add some Account.advanced_search_for tests for existing behaviors

* Add some tests for Account.search_for

* Add Account.advanced_search_for tests unconfirmed and unapproved accounts

* Add Account.searchable tests

* Fix Account.without_unapproved scope potentially messing with previously-applied scopes

* Allow lookup of unconfirmed/unapproved accounts through /api/v1/accounts/lookup

This is so that the API can still be used to check whether an username is free
to use.
3 years ago
Claire e38fc319dc
Refactor and improve tests (#17386)
* Change account and user fabricators to simplify and improve tests

- `Fabricate(:account)` implicitly fabricates an associated `user` if
  no `domain` attribute is given (an account with `domain: nil` is
  considered a local account, but no user record was created), unless
  `user: nil` is passed
- `Fabricate(:account, user: Fabricate(:user))` should still be possible
  but is discouraged.

* Fix and refactor tests

- avoid passing unneeded attributes to `Fabricate(:user)` or
  `Fabricate(:account)`
- avoid embedding `Fabricate(:user)` into a `Fabricate(:account)` or the other
  way around
- prefer `Fabricate(:user, account_attributes: …)` to
  `Fabricate(:user, account: Fabricate(:account, …)`
- also, some tests were using remote accounts with local user records, which is
  not representative of production code.
3 years ago
Claire 02a87431cf
Fix error when suspending user with an already-existing canonical email block (#17036)
* Fix error when suspending user with an already-existing canonical email block

Fixes #17033

While attempting to create a `CanonicalEmailBlock` with an existing hash would
raise an `ActiveRecord::RecordNotUnique` error, this being done within a
transaction would cancel the whole transaction. For this reason, checking for
uniqueness in Rails would query the database within the transaction and avoid
invalidating the whole transaction for this reason.

A race condition is still possible, where multiple accounts sharing a canonical
email would be blocked in concurrent transactions, in which only one would
succeed, but that is way less likely to happen that the current issue, and can
always be retried after the first failure, unlike the current situation.

* Add tests
3 years ago
Claire 5cc45d22d3
Remove subscription_expires_at leftover from OStatus (#15857) 4 years ago
Eugen Rochko 216b85b053
Fix performance on instances list in admin UI (#15282)
- Reduce duplicate queries
- Remove n+1 queries
- Add accounts count to detailed view
- Add separate action log entry for updating existing domain blocks
4 years ago