1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-27 13:08:25 +09:00
Commit Graph

102 Commits

Author SHA1 Message Date
Matt Jankowski
92b3004bf3
Reference constants from account validation specs () 2024-06-10 15:03:41 +00:00
Matt Jankowski
6262ceeb70
Fix RSpec/DescribedClass cop () 2024-03-13 15:42:39 +00:00
Matt Jankowski
c09b8a7164
Add Account.without_internal scope ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2024-03-13 14:11:23 +00:00
Matt Jankowski
245064bb98
Move "everyone" role and "instance actor" account magic number IDs to constants () 2024-02-19 11:09:43 +00:00
Matt Jankowski
95da28d201
Add common ThreadingHelper module for specs () 2024-02-07 14:53:29 +00:00
Matt Jankowski
18004bf227
Add Account.matches_uri_prefix scope and use in activitypub/followers_synchronizations controller () 2024-01-22 13:55:37 +00:00
Matt Jankowski
1480573c83
Add Account.auditable scope, fix N+1 in admin/action_logs#index () 2024-01-19 01:39:30 +00:00
Matt Jankowski
07e10e3747
Combine assertions about same setup in Account#suspend! spec () 2024-01-18 09:36:59 +00:00
Matt Jankowski
cd37048439
Move followable_by coverage to suggestions () 2024-01-12 09:11:34 +00:00
Matt Jankowski
8b26614fa7
Combine results include check in spec/models/account () 2024-01-11 16:17:45 +00:00
Matt Jankowski
0a7cff53c2
Add coverage for Account.followable_by scope () 2024-01-11 09:30:29 +00:00
Matt Jankowski
c753b1ad35
Clean up of RSpec/LetSetup within spec/models () 2023-12-21 09:18:38 +00:00
Matt Jankowski
440b80b2e7
Model concerns organization into module namespaces () 2023-12-01 11:00:41 +00:00
Matt Jankowski
d2aacea8da
Reduce .times usage in AccountSearch spec, use constant for default limit () 2023-11-20 09:08:22 +00:00
Matt Jankowski
b2c5b20ef2
Fix RSpec/AnyInstance cop () 2023-11-14 14:52:59 +00:00
Matt Jankowski
bcd0171e5e
Fix Lint/UselessAssignment cop () 2023-10-19 16:55:06 +02:00
Matt Jankowski
a1b27d8b61
Fix Naming/VariableNumber cop () 2023-10-18 14:26:22 +02:00
Matt Jankowski
c676bc91e9
Dont match mention in url query string ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-10-03 17:01:45 +02:00
Claire
1e3b19230a
Add stricter protocol fields validation for accounts () 2023-07-20 18:23:48 +02:00
Matt Jankowski
c75df62ccc
Fix RSpec/SubjectDeclaration cop () 2023-07-12 09:49:33 +02:00
Matt Jankowski
6c0e3f490a
Fix RSpec/MissingExampleGroupArgument cop () 2023-06-06 15:51:42 +02:00
Matt Jankowski
c42591356d
Fix RSpec/DescribedClass cop () 2023-06-06 13:58:33 +02:00
Nick Schonning
99e2e9b81f
Fix minor typos in comments and spec names () 2023-05-19 17:13:29 +02:00
Matt Jankowski
c97b611b6b
Fix RSpec/InferredSpecType cop () 2023-05-04 05:49:53 +02:00
Matt Jankowski
710745e16b
Fix RSpec/ContextWording cop () 2023-05-04 05:49:08 +02:00
Matt Jankowski
570079f8ce
Fix Performance/TimesMap cop () 2023-05-02 18:07:16 +02:00
Matt Jankowski
274d561430
Enable local account key generation spec () 2023-04-30 02:28:52 +02:00
Nick Schonning
a3393d0d07
Autofix Rubocop RSpec/MatchArray () 2023-04-26 20:21:54 +02:00
Matt Jankowski
cd99fa8ceb
Fabricator specs () 2023-03-04 17:12:09 +01:00
Nick Schonning
84cc805cae
Enable Style/FrozenStringLiteralComment for specs () 2023-02-22 09:55:31 +09:00
Nick Schonning
5116347eb7
Autofix Rubocop RSpec/BeEq () 2023-02-20 06:14:50 +01:00
Nick Schonning
bf785df9fe
Audofix Rubocop Style/WordArray () 2023-02-20 06:14:10 +01:00
Nick Schonning
4552685f6b
Autofix Rubocop RSpec/LeadingSubject () 2023-02-20 13:24:14 +09:00
Nick Schonning
65ba0d92ef
Enable Rubocop RSpec/NotToNot () 2023-02-20 02:33:27 +01:00
Nick Schonning
81ad6c2e39
Autofix Rubocop Style/StringLiterals () 2023-02-19 07:38:14 +09:00
Nick Schonning
3680e032b4
Autofix Rubocop RSpec/EmptyLineAfterFinalLet () 2023-02-19 07:10:19 +09:00
Claire
70415714f1
Add follow request banner on account header ()
* Add requested_by to relationship maps

* Display whether an account has requested to follow you on their profile
2022-12-15 18:50:11 +01:00
Jeong Arm
d412147d02
Save avatar or header correctly even if other one fails ()
* Save avatar or header correctly if other one fails

* Fix test
2022-12-15 17:11:14 +01:00
luzpaz
6ba52306f9
Fix typos ()
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`
2022-11-08 17:32:03 +01:00
Roni Laukkarinen
36b0ff57b7
Fix grammar () 2022-11-08 16:35:42 +01:00
Eugen Rochko
44b2ee3485
Add customizable user roles ()
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
2022-07-05 02:41:40 +02:00
Claire
440eb71310
Change unapproved and unconfirmed account to not be accessible in the REST API ()
* 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.
2022-05-26 15:50:33 +02:00
Claire
e38fc319dc
Refactor and improve tests ()
* 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.
2022-01-28 00:46:42 +01:00
Claire
02a87431cf
Fix error when suspending user with an already-existing canonical email block ()
* Fix error when suspending user with an already-existing canonical email block

Fixes 

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
2021-11-24 17:41:03 +01:00
Claire
5cc45d22d3
Remove subscription_expires_at leftover from OStatus () 2021-03-12 05:25:24 +01:00
Eugen Rochko
216b85b053
Fix performance on instances list in admin UI ()
- Reduce duplicate queries
- Remove n+1 queries
- Add accounts count to detailed view
- Add separate action log entry for updating existing domain blocks
2020-12-14 09:06:34 +01:00
Eugen Rochko
337dc6e0ad
Fix updating account counters when account_stat is not yet created () 2020-11-09 16:00:23 +01:00
abcang
61a7390b66
Search account domain in lowercase ()
* Search account domain in lowercase

* fix rubocop error

* fix spec/models/account_spec.rb
2020-02-01 15:42:24 +01:00
ThibG
57e2833f6a Remove dependency on OStatus2 gem () 2020-01-11 21:36:53 +01:00
Eugen Rochko
49b2f7c0a2
Fix base64-encoded file uploads not being possible ()
Fix , Fix 
2020-01-04 01:54:07 +01:00