about summary refs log tree commit diff
path: root/spec/models/account_spec.rb
AgeCommit message (Collapse)Author
2020-02-01Search account domain in lowercase (#13016)abcang
* Search account domain in lowercase * fix rubocop error * fix spec/models/account_spec.rb
2020-01-11Remove dependency on OStatus2 gem (#12822)ThibG
2020-01-04Fix base64-encoded file uploads not being possible (#12748)Eugen Rochko
Fix #3804, Fix #5776
2019-10-09Fix attachment not being re-downloaded even if file is not stored (#12125)Eugen Rochko
Change the behaviour of remotable concern. Previously, it would skip downloading an attachment if the stored remote URL is identical to the new one. Now it would not be skipped if the attachment is not actually currently stored by Paperclip.
2019-08-06Bump faker from 1.9.6 to 2.1.0 and update faker api (#11489)Yusuke Nakamura
* Bump faker from 1.9.6 to 2.1.0 Bumps [faker](https://github.com/stympy/faker) from 1.9.6 to 2.1.0. - [Release notes](https://github.com/stympy/faker/releases) - [Changelog](https://github.com/stympy/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/stympy/faker/compare/1.9.6...v2.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Use faker api v2 https://github.com/stympy/faker/releases/tag/2.0
2019-07-24 Don't delete periods when validating username uniqueness (#11392) (#11400)Rey Tucker
* Check to make sure usernames with '.' cannot be created * Add test for instance actor account name conflicts This makes sure that migration 20190715164535_add_instance_actor won't fail if there's already an account that is named the same as the domain (minus the .) * Put the test into the correct context... * Add another test to split this into two validations * Don't delete periods when validating username uniqueness (#11392) The 20190715164535_add_instance_actor migration fails if there's already a username similar to the domain name, e.g. if you are 'vulpine.club' and have a user named 'vulpineclub', validation fails. Upon further review, usernames with periods are dropped by the regular expression in the Account class, so we don't need to worry about it here. Fixes #11392
2019-07-19Add ActivityPub actor representing the entire server (#11321)ThibG
* Add support for an instance actor * Skip username validation for local Application accounts * Add migration script to create instance actor * Make Codeclimate happy * Switch to id -99 for instance actor * Remove unused `icon` and `image` attributes from instance actor * Use if/elsif/else instead of return + ternary operator * Add instance actor to fresh installs * Use instance actor as instance representative Use instance actor for forwarding reports, relay operations, and spam auto-reporting. * Seed database in test environment * Fix single-user mode * Fix tests * Fix specs to accomodate for an extra `Account` * Auto-reject follows on instance actor Following an instance actor might make sense, but we are not handling that right now, so auto-reject. * Fix webfinger lookup and serialization for instance actor * Rename instance actor * Make it clear in the HTML view that the instance actor should not be blocked * Raise cache time for instance actor as there's no dynamic content * Re-use /about/more with a flash message for instance actor profile
2019-06-22Change domain blocks to automatically support subdomains (#11138)Eugen Rochko
* Change domain blocks to automatically support subdomains If a more authoritative domain is blocked (example.com), then the same block will be applied to a subdomain (foo.example.com) * Match subdomains of existing accounts when blocking/unblocking domains * Improve code style
2019-05-21Update remote bio test from 160 to 500 (#10799)trwnh
2019-05-19Change bio limit from 160 to 500 (#10790)trwnh
* Change note_length validator from 160 to 500 * Change input maxlength from 160 to 500 * update bio test from 160 to 500 * Multiply a string 30 times instead of 10
2019-03-11Squish username before validation (#10239)Aurélien Reeves
* Squish username before validation (#10101) Fix #10101 * Move before_validation hook to a private method Also add Unicode wite-spaces to the spec to support the use of squish over strip.
2018-11-27Allow hyphens in the middle of remote user names (#9345)ThibG
Fixes #9309 This only allows hyphens in the middle of a username, much like dots, although I don't have a compelling reason to do so other than keeping the changes minimal.
2018-11-19Extract counters from accounts table to account_stats table (#9295)Eugen Rochko
2018-10-04lint pass 2 (#8878)aus-social
* Code quality pass * Typofix * Update applications_controller_spec.rb * Update applications_controller_spec.rb
2018-09-14Misc. typos (#8694)luzpaz
Found via `codespell -q 3 --skip="./app/javascript/mastodon/locales,./config/locales"`
2018-07-30Enforce username format for remote users, too (#8102)Eugen Rochko
Initially I thought there might be valid reasons for remote users to have a different, unpredicted username format. However, I now realize such a difference would be unusable and unexpected within Mastodon. Fix #8058
2018-07-03Re-add follow recommendations API (#7918)Eugen Rochko
* Re-add follow recommendations API GET /api/v1/suggestions Removed in 8efa081f210d72ed450c39ac4cde0fd84fb3d3fb due to Neo4J dependency. The algorithm uses triadic closures, takes into account suspensions, blocks, mutes, domain blocks, excludes locked and moved accounts, and prefers more recently updated accounts. * Track interactions with people you don't follow Replying to, favouriting and reblogging someone you're not following will make them show up in follow recommendations. The interactions have different weights: - Replying is 1 - Favouriting is 10 (decidedly positive interaction, but private) - Reblogging is 20 Following them, muting or blocking will remove them from the list, obviously. * Remove triadic closures, ensure potential friendships are trimmed
2018-05-30Improve counter caches on Status and Account (#7644)Eugen Rochko
Do not touch statuses_count on accounts table when mass-destroying statuses to reduce load when removing accounts, same for reblogs_count and favourites_count Do not count statuses with direct visibility in statuses_count Fix #828
2018-05-02Speed up test suite by not generating RSA keys in test environment (#7296)Eugen Rochko
One RSA keypair for all fabricated test accounts is enough
2018-04-25Append '.test' to hostname in stub data (#7260)MIYAGI Hikaru
2018-01-22Rename ResolveRemoteAccountService to ResolveAccountService (#6327)Akihiko Odaki
The service used to be named ResolveRemoteAccountService resolves local accounts as well.
2017-11-06Implement tests for Account#refresh! (#5601)ysksn
2017-11-06Add test for Account#save_with_optional_media! (#5603)ysksn
There was a test when some of the properties are invalid, but none when all of them are valid.
2017-11-05Implement tests for Account#possibly_stale? (#5591)ysksn
2017-08-21Do not try to re-subscribe to unsubscribed accounts (#4653)Eugen Rochko
2017-06-22Some minor change and spec for Account (#3813)Akihiko Odaki (@fn_aki@pawoo.net)
* Introduce domains method to Account relation Account had followers_domains method, which was excessively specific. Let relation of Account have domains method instead. * Move follow_mapping in Account to AccountInteractions * Introduce shared examples for AccountAvatar inclusion * Cover Account more
2017-06-08Fix db:seed - only run some validations when the field was changed (#3592)Eugen Rochko
* Fix db:seed - only run some validations when the field was changed * Add tests
2017-06-05Added support for configurable reserved usernames (fix of #1382) (#3566)Eugen Rochko
* Added support for configurable reserved usernames * Added reserved usernames from mastodon issue 1355 * Fix reserved usernames
2017-05-31Expand spec coverage and refactor the `Account.find_` methods (#3485)Matt Jankowski
* 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
2017-05-16Improve Account#triadic_closures (#3079)alpaca-tc
2017-05-05use Twitter::Extractor for creating links (#2502)masarakki
2017-04-30Revert "Use PostgreSQL inheritance for blocks and mutes (#2520)" (#2634)Akihiko Odaki
This reverts commit 5135d609b774b177d3d3894b176a822d86b73d3c.
2017-04-30Use PostgreSQL inheritance for blocks and mutes (#2520)Akihiko Odaki
2017-04-28More status specs (#2564)Matt Jankowski
* Add rough outline of coverage needed for public timeline * Specs for visibility, replies, boosts * Specs for silenced account * Specs for local_only option * Specs for blocks and mutes * Add tentative spec around including other silenced account statuses * Add with_public_visibility scope * Add simple coverage for tag_timeline * Tag timeline includes replies * Replace tag.statuses with a tagged_with scope in tag timeline method * Use with_public_visibility in tag timeline * Extract common scope between public and tag timelines to method * Extract local domain check to local_only scope * Extract local_only check to starting scope method * Move list of excluded from timeline account ids to account model * Simplify excluded accounts list on account model * Only join accounts when needed * Rename method for account specific filtering * Extract method for account exclusions * Fix bug where silenced accounts were not including statuses from other silenced accounts * DRY up filter application from account or no account * timeline_scope can be private * Add spec showing that account can find its excluded accounts ids * Add spec which fails if local_only does not have a left outer join * rubocop
2017-04-18Instances list in admin (#2095)Matt Jankowski
* Add admin/instances index action * Add link to instances admin page * View lists instances * Instances, grouped by domain, ordered by count * Use Account.remote scope * Extract method: Account.by_domain_accounts
2017-04-18Remove unused methods (#1730)Matt Jankowski
* Remove unused method #set_counters_maps from api controller * Remove unused method #set_account_counters_maps from api controller * Remove unused method Account#followers_domains * Remove unused User.prolific scope * Add mastodon:users:admins task to list all admin emails * Use interpolated query style in Account.triadic_closures * Coverage for Account.triadic_closures
2017-04-13Remove pending specs for methods that dont exist (#1658)Matt Jankowski
* Remote spec for non-existent entry_classes helper method This method no longer exists, and is handled by a local variable in a partial instead. * Remove spec for non-existent Account#ping! method
2017-04-11When avatar/header are GIF, generate static versions (#1428)Eugen
* When avatar/header are GIF, generate static versions. Account API returns "avatar"/"avatar_static", "header"/"header_static" Static version is the same as original for other cases Web UI de-animates avatars in toots, lists of users Fix #441, fix #596, prerequisite for #1064 * Fix JS test * Add rake task to generate static avatars/headers from GIF ones, add test
2017-04-10Clean up generation of account webfinger string (#1477)Matt Jankowski
* Consolidate webfinger string creation under Account#to_webfinger_s * Introduce Account#local_username_and_domain for consolidation
2017-04-09Search cleanup (#1333)Matt Jankowski
* Clean up SQL output in Tag and Account search methods * Add basic coverage for Tag.search_for * Add coverage for Account.search_for * Add coverage for Account.advanced_search_for
2017-04-07DRY up reblog vs original status checkJoël Quenneville
Checking reblog vs original status was happening in multiple places across the app. For views, this logic was encapsulated in a helper method named `proper_status` but in the other layers of the app, the logic was duplicated. Because the logic is used at all layers of the app, we extracted it into a `Status#proper` method on the model and changed all uses of the logic to use this method. There is now a single source of truth for this condition. We added test coverage to untested methods that got refactored.
2017-04-05update account_specSamy KACIMI
2017-04-05add more tests to modelsSamy KACIMI
2017-03-05Fix wrongful matching of last period in extended usernamesEugen Rochko
Fix anchor tags in some wikipedia URLs being matches as a hashtag
2017-01-09Persist UI settings, add missing localizations for GermanEugen Rochko
2016-11-13Fix #142 - Escape ILIKE special characters from Account.find_remoteEugen Rochko
2016-09-20Upgrade to PubSubHubbub 0.4 (removing verify_token)Eugen Rochko
2016-09-09Refactored generation of unique tags, URIs and object URLs into own classes,Eugen Rochko
as well as formatting of content
2016-03-27Fix mentions regex to exclude usernames in Medium URLsEugen Rochko
2016-03-25Fix subscriptions:clear task, refactor feeds, refactor streamable activitesEugen Rochko
and atom feed generation to some extent, as well as the way mentions are stored