about summary refs log tree commit diff
path: root/spec
AgeCommit message (Collapse)Author
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
2017-04-23Test embedded_view related code in a helper (#2282)Joël Quenneville
The two methods `StreamEntriesHelper#stream_link_target` and `StreamEntriesHelper#acct` are based on checking whether we are running in an embedded view. This adds some test helper code to make the testing easier. We extracted some "magic strings" to constants to lower the coupling in the specs.
2017-04-23Add test coverage to CSS class generation (#2285)Joël Quenneville
The code that generates CSS is based on a lot of boolean conditions. The possible combinations of these grows exponentially as we add more conditions. Since most of the code is conditional on a single boolean, we tested the following: 1. All `false` 2. All `true` 3. Each individual flag set to `true` The methods tested are: * `StreamEntriesHelper#style_classes` * `StreamEntriesHelper#microformats_classes` * `StreamEntriesHelper#microformats_h_class`
2017-04-23ActivityPub: Add basic, read-only support for Outboxes, Notes, and ↵Evan Minto
Create/Announce Activities (#2197) * Clean up collapsible components * Expose user Outboxes and AS2 representations of statuses * Save work thus far. * Fix bad merge. * Save my work * Clean up pagination. * First test working. * Add tests. * Add Forbidden error template. * Revert yarn.lock changes. * Fix code style deviations and use localized instead of hardcoded English text.
2017-04-23Admin UI for confirming users (#2245)Ash Furrow
* Shows confirmed status in list. * Adds ability to confirm users in admin UI. * Added new english translations. * Addresses feedback from #2245. * More feedback.
2017-04-22Add og:url tags (#2298)Wesley Ellis
* add og:url to stream_item view * add og:url and text to about/show * add og:url to profile, followers and follows pages
2017-04-22[WIP] Html lang on statuses (#2297)Matt Jankowski
* Add html lang attributes around statuses * Remove urls from language detection
2017-04-222FA controller cleanup (#2296)Matt Jankowski
* Add spec coverage for settings/two_factor_auth area * extract setup method for qr code * Move otp required check to before action * Merge method only used once * Remove duplicate view * Consolidate creation of @codes for backup * Move settings/2fq#recovery_codes to settings/recovery_codes#create * Rename settings/two_factor_auth#disable to #destroy * Add coverage for the otp required path on 2fa#show * Clean up the recovery codes list styles * Move settings/two_factor_auth to settings/two_factor_authentication * Reorganize the settings two factor auth area Updated to use a flow like: - settings/two_factor_authentication goes to a #show view which has a button either enable or disable 2fa on the account - the disable button turns off the otp requirement for the user - the enable button cycles the user secret and redirects to a confirmation page - the confirmation page is a #new view which shows the QR code for user - that page posts to #create which verifies the code, and creates the recovery codes - that create action shares a view with a recovery codes controller which can be used separately to reset codes if needed
2017-04-22Add tests for StreamEntriesHelper#rtl? (#2286)Joël Quenneville
We used some random Arabic characters to test that the various RTL conditions got triggered.
2017-04-21User settings mutation (#2270)Matt Jankowski
* Add user spec for settings, highlight global default mutation issue * Fix mutation issue caused by settings/preferences spec
2017-04-21Clean up settings/preferences controller (#2237)Matt Jankowski
* Add missing fields group on preferences page * Clean up settings/preferences controller * Extract a UserSettingsDecorator