about summary refs log tree commit diff
path: root/spec
AgeCommit message (Collapse)Author
2017-05-05More robust PuSH subscription refreshes (#2799)Eugen Rochko
* Fix #2473 - Use sidekiq scheduler to refresh PuSH subscriptions instead of cron Fix an issue where / in domain would raise exception in TagManager#normalize_domain PuSH subscriptions refresh done in a round-robin way to avoid hammering a single server's hub in sequence. Correct handling of failures/retries through Sidekiq (see also #2613). Optimize Account#with_followers scope. Also, since subscriptions are now delegated to Sidekiq jobs, an uncaught exception will not stop the entire refreshing operation halfway through Fix #2702 - Correct user agent header on outgoing http requests * Add test for SubscribeService * Extract #expiring_accounts into method * Make mastodon:push:refresh no-op * Queues are now defined in sidekiq.yml * Queues are now in sidekiq.yml
2017-05-04Remove the react-rails gem (#2801)Matt Jankowski
* Remove react-rails gem * Fix broken view spec
2017-05-04Delete records in smaller transaction (#2802)alpaca-tc
2017-05-04Remove redis clear from before in spec (#2795)Matt Jankowski
2017-05-04Replace best_in_place editor on admin settings page (#2789)Matt Jankowski
* Remove best_in_place * Replace best_in_place usage with rails helpers * Move admin/settings#index to #edit action * Remove click_to__edit from i18n
2017-05-04Likely fix #2458, fix #2031 - handle out-of-order deletes for statuses (#2734)Eugen Rochko
* Likely fix #2458, fix #2031 - handle out-of-order deletes for statuses If a delete arrives before the original status, cache that information for 6h, and if the original status arrives in that window, ignore it * Add test case
2017-05-03Additional specs for URI handling (#2759)ThibG
2017-05-03Fix #2706 - Always respond with 200 to PuSH payloads (#2733)Eugen Rochko
Fix #2196 - Respond with 201 when Salmon accepted, 400 when unverified Fix #2629 - Correctly handle confirm_domain? for local accounts Unify rules for extracting author acct from XML, prefer <email>, fall back to <name> + <uri> (see also #2017, #2172)
2017-05-03Language improvements, replace whatlanguage with CLD (#2753)Matt Jankowski
* add failing en specs * add cld2 gem * Replace WhatLanguage with CLD
2017-05-03Replace sprockets/browserify with Webpack (#2617)Eugen Rochko
* Replace browserify with webpack * Add react-intl-translations-manager * Do not minify in development, add offline-plugin for ServiceWorker background cache updates * Adjust tests and dependencies * Fix production deployments * Fix tests * More optimizations * Improve travis cache for npm stuff * Re-run travis * Add back support for custom.scss as before * Remove offline-plugin and babili * Fix issue with Immutable.List().unshift(...values) not working as expected * Make travis load schema instead of running all migrations in sequence * Fix missing React import in WarningContainer. Optimize rendering performance by using ImmutablePureComponent instead of React.PureComponent. ImmutablePureComponent uses Immutable.is() to compare props. Replace dynamic callback bindings in <UI /> * Add react definitions to places that use JSX * Add Procfile.dev for running rails, webpack and streaming API at the same time
2017-05-02Auth sign out (#2511)Matt Jankowski
* Add a spec for signing out * Add spec showing that suspended user gets a 403 forbidden on sign out * Allow suspended account users to sign out
2017-05-02Add rspec to further specify FollowRemoteAccountService (#2414)ThibG
2017-05-02Add option to disable two factor auth in admin accounts panel. (#2584)Kaylee
* Add option to disable two factor auth in admin accounts panel. Closes #2578 * Add @mjankowski's suggestions. * Moves destroy actions behind User#disable_two_factor! * Adds spec coverage for Admin:TwoFactorAuthenticationsController and User#disable_two_factor!
2017-05-02Fix subscription expiration condition (#2715)Yamagishi Kazutoshi
* Fix subscription expiration condition * dry and add spec
2017-05-02Coverage for remote follows (#2694)Matt Jankowski
* Add coverage for create with empty acct value * Add coverage for create with webfinger failure * Add coverage for create with webfinger providing bad values * Add coverage for create when webfinger is good * Add coverage for session[:remote_follow] having data * Simplify how remote follow pulls acct from session * Remote follow behaves more like model * Move the discovery portions of remote follow out of controller * Check for suspended accounts
2017-05-01Filter on allowed user language preferences (#2361)Matt Jankowski
* Naive approached to timeline filtering * Convert allowed_languages into a db column * Allow users to choose languages to see statuses in * Style list items as two columns * Add a hint to explain language filtering preference
2017-04-30Reports spec for media attachments, clean up method (#2660)Matt Jankowski
* Add coverage for Report#media_attachments * Direct query on media attachment
2017-04-30Revert "Use PostgreSQL inheritance for blocks and mutes (#2520)" (#2634)Akihiko Odaki
This reverts commit 5135d609b774b177d3d3894b176a822d86b73d3c.
2017-04-30Extract user tracking into concern (#2600)Matt Jankowski
2017-04-30Use PostgreSQL inheritance for blocks and mutes (#2520)Akihiko Odaki
2017-04-30More coverage yes more even more (#2627)Matt Jankowski
* Add coverage for admin/confirmations controller * Coverage for statuses controller show action * Add coverage for admin/domain_blocks controller * Add coverage for settings/profiles#update
2017-04-29Add tests to the Feed model (#2594)Joël Quenneville
This adds a test for the `Feed#get` method. While the data transformations in `Feed#get` may seem redundant, they are important to maintain the order from Redis. The tests I wrote will fail if someone tries to refactor away this "redundancy" (as I tried to do in the first iteration of this change).
2017-04-29Set correct attachment type for rejected media (#2599)Patrick Figel
In #2110, a new attachment type "unknown" was introduced for attachments that were rejected due to a domain being blocked using reject_media. However, the "type" field was never set to "unknown" because a default value of "0" (image) is set for that column, causing the `type.blank?` expression to always equal false. This version uses type_changed? instead, causing the type to be set to "unknown" unless a type has been explicitly set. This introduces a small change in behaviour causing the type to be set to unknown before paperclip calls `before_post_process`. Presumably this behaviour is more appropriate than the current one because the attachment type has not been determined by that point. Included are new tests for `ProcessFeedService` and `UpdateRemoteProfileService` which now check that remote media is downloaded for non-blocked domains and is rejected for others.
2017-04-28Fix broken view spec for about/links (#2591)Matt Jankowski
2017-04-28Fix broken spec for about/links view partial (#2586)Matt Jankowski
2017-04-28Fix spec for hide get started (#2585)Yamagishi Kazutoshi
2017-04-28More controller specs (#2561)Matt Jankowski
* Add render_views in more places * Delegate methods from account to user with allow nil true, so that admin accounts show view renders when missing a user * Use actual account instances in authorize follow controller spec
2017-04-28Return missing page when tag does not exist (#2563)Matt Jankowski
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-28Add render_views to admin/reports controller spec (#2548)Matt Jankowski
2017-04-28Fix remote follow (#2547)Matt Jankowski
* Add coverage for remote_follow#new * Fix reference to authorize_follows/card partial
2017-04-27Improve shared status verification (#2525)Eugen Rochko
* Instead of parsing shared status contents verbatim, make roundtrip to purported original URL. Confirm that the "original" URL is from the same domain as the author it claims to be from. * Fix obvious typo, add comment * Use URI look-up first * Add test, update Goldfinger dependency to make less useless HTTP requests per Webfinger lookup
2017-04-27Catch error when server decryption fails on 2FA (#2512)Matt Jankowski
2017-04-27OEmbed support for PreviewCard (#2337)Eugen Rochko
* OEmbed support for PreviewCard * Improve ProviderDiscovery code failure treatment * Do not crawl links if there is a content warning, since those don't display a link card anyway * Reset db schema * Fresh migrate * Fix rubocop style issues Fix #1681 - return existing access token when applicable instead of creating new * Fix test * Extract http client to helper * Improve oembed controller
2017-04-27Add spec coverage and refactor authorize_follows controller (#2505)Matt Jankowski
2017-04-26Domain block service cleanup (#2490)Matt Jankowski
* Add coverage for domain block service with silence * Get rid of warning about find_each and order * Move domain_block to attr_reader * Move optional clear_media into silence_accounts method * Use blocked_domain method to reduce passed vars * Extract blocked_domain_accounts method to find accounts on the domain * Extract media_from_blocked_domain method to find relevant attachments * Separate destruction of account images and account attachments
2017-04-26Add spec for Status.as_home_timeline (#2451)Matt Jankowski
2017-04-26Add media dimensions (#2448)Francis Chong
* Fixes #1985 - add migration AddMediaAttachmentMeta, which add meta field to media_attachments - before saving attachment, set file meta if needed - add meta in api * add spec * align the “size” format for image and video * fix code climate * fixes media_attachment_spec.rb
2017-04-26Stricter whitelist rules (#2213)Guillaume Lo Re
* Stricter whitelist rules * Linting * Added spec for blacklisting * Test subdomain blacklist on domain whitelist * No need to split * Change spec name
2017-04-25Localize with i18n for Devise::FailureApp (#2309)alpaca-tc
This PR fixes I18n.locale for rake middlewares. Mastodon uses Devise that depends on Warden. Warden::Manager can be found in rake middleware. It is outside of the controller. In the case of authentication failed, warden calls throw(:warden). At the time Warden::Manager delegates request to failure_app to generate response and flash[:alert] after catching it. Unfortunately, I18n.locale is already reset then because I18n.with_locale is enabled only inside the controller. If we used I18n.locale=, Devise::FailureApp could get the current locale.
2017-04-25Change ActivityPub paging to match spec. Clean up ActivityPub outbox ↵Evan Minto
changes. (#2410) * Change ActivityPub paging to match spec. Clean up ActivityPub outbox changes. * Fix code style and test failures for OutboxController. * Attempt to fix CI errors.
2017-04-25Fix #2402 - Add Idempotency-Key header to PostStatusService that prevents ↵Eugen Rochko
(#2419) duplicates. Web UI regenerates UUID for that header every time the compose form is changed or successfully submitted Also, fix Farsi i18n overwriting the English one
2017-04-25Decodes URL containing IDN (#2436)Yamagishi Kazutoshi
2017-04-25Optimize account search (#2421)178inaba
2017-04-25Punycode URI normalization (#2370)Eugen
* Fix #2119 - Whenever about to send a HTTP request, normalize the URI * Add test for IDN request in FetchLinkCardService * Perform IDN normalization on domains before they are stored in the DB
2017-04-24Add more FeedManager#filter? tests (#2413)Eugen
2017-04-24Fix flashes partial render error for controllers which don't inherit from ↵Matt Jankowski
application controller (#2400) * Add failing spec for oauth/authorized_applications controller * Use explicit reference to flashes partial from admin layout Because some of the controllers which use the admin layout do not inherit from application controller, this partial is not in their view path.
2017-04-24Followers-only post federation (#2111)Eugen
* Make private toots get PuSHed to subscription URLs that belong to domains where you have approved followers * Authorized followers controller, stub for bulk action * Soft block in the background * Add simple test for new controller * Rename Settings::FollowersController to Settings::FollowerDomainsController, paginate results, rename "private" post setting to "followers-only", fix pagination style, improve post privacy preferences style, improve warning style * Extract compose form warnings into own container, show warning when posting to followers-only with unlocked account
2017-04-23Fix deprecation warnings on activitypub controller specs (#2357)Matt Jankowski
2017-04-23Ensure i18n matches options (#2358)Matt Jankowski
* Add failing spec showing that human_locales does not match what i18n knows about * Add missing `ar` key for arabic to human locales * Remove duplicate `id` key from available locales * Sort keys in human locales list * Add spec for human_locale helper