about summary refs log tree commit diff
path: root/spec
AgeCommit message (Collapse)Author
2017-04-16Make file attachment on MediaAttachment optional (#1865)Eugen
Create MediaAttachment but without actual file download when domain is blocked with reject_media set to true Clean up old media files when creating a new domain block with reject_media set to true Return remote_url in media attachments API if local file is not present Undo domain block action in admin UI Ability to enable reject_media from admin UI
2017-04-16View spec fix (#1888)Matt Jankowski
* Add option to disable verify partial doubles * Add show_landing_strip? helper method * Use show_landing_strip? helper in accounts and stream entries views * Fix naming in view specs
2017-04-15Add password reset for users from admin accounts area (#1841)Matt Jankowski
2017-04-15About page contact email (#1839)Matt Jankowski
* Correct site_contact_email typo * Separate about more page into partials, add specs
2017-04-15Silence Devise deprecation warning about TestHelpers (#1840)Matt Jankowski
Devise changed their approach - https://github.com/plataformatec/devise/commit/3f3ec236bb50a2ae8b0eede90d8f7ecd201d7dbb This change silences a deprecation warning about `TestHelpers`
2017-04-15Add recovery code support for two-factor auth (#1773)Patrick Figel
* Add recovery code support for two-factor auth When users enable two-factor auth, the app now generates ten single-use recovery codes. Users are encouraged to print the codes and store them in a safe place. The two-factor prompt during login now accepts both OTP codes and recovery codes. The two-factor settings UI allows users to regenerated lost recovery codes. Users who have set up two-factor auth prior to this feature being added can use it to generate recovery codes for the first time. Fixes #563 and fixes #987 * Set OTP_SECRET in test enviroment * add missing .html to view file names
2017-04-15Account search service refactor (#1791)Matt Jankowski
* Begin coverage for account search service * Coverage for hashtag query * Coverage for calling local vs remote find based on domain presence * Spec to check that exact matches are not duped * Coverage of resolve option * Coverage for account being provided * Start to refactor account search service * Isolate query username and domain methods * Isolate exact_match method * Extract methods for local and remote results * Simplify local vs remote and account isoliation * Extract methods for local and remote results * Simplify de-dupe of exact match * Simplify logic to check for non exact remotes * Cache some methods * Remove nil from exact_match from results array * Return exact matches first * Use find_remote even with no domain Account.find_local is just an alias for Account.find_remote(user, nil) - so we can not bother with the conditional here, and call find_remote directly.
2017-04-15Refresh webfinger (#1323)ThibG
* Refresh local info for remote accounts when webfinger returns new values It only refreshes account info if one of the URLs or the public-key changes, in which cases it refreshes the full info, re-downloading the feeds from that user. Some special handling should probably be done when the public key changes, but I have been unable to find any use for it in Mastodon yet. * Re-fetch remote users we aren't subscribed to. This might induce performance issues, we might want to only do that for users we explicitly attempted to subscribe but failed to. * Refactor changes * Do not refresh existing remote account details more than once a day * Avoid re-fetching webfinger info in tests unless otherwise specified
2017-04-15Rename admin/accounts_helper to admin/filter_helper (#1816)Matt Jankowski
- Add some spec coverage for both methods - Add explicit constant call-outs for where the params are from
2017-04-15add basic microformats tests (#1803)Ben Roberts
as suggested, moving to view tests rather than a controller test replaces https://github.com/tootsuite/mastodon/pull/1786 which i will close momentary
2017-04-15Introduce capybara and first feature spec (#1801)Chad Pytel
This commit introduces Capybara and the first feature spec. I focused on coverage for log in for the first feature spec because that would have prevented 624a9a7136159d460228a0c2f5df18a9ead3b7f2 causing #1236.
2017-04-15Improve i18n chooser (#1804)Matt Jankowski
* Add locale spec with failing locale plus region check * Use a more accurate locale when supplied by browser headers Previously we were using a matching option which would use the first locale available which matched the locale portion, even if a region was specified. This changes to first try to find an exact match, and then fall back to the region, and then fall back to the default. * Clean up default_locale method
2017-04-14Admin reports controller improvements (#1714)Matt Jankowski
* Simplify admin/reports controller filtering for index * Rename parameter to resolved * Fix issue where reports view could not access filter_link_to * Add coverage for admin/reports controller * DRY up resolution of related reports for target account * Clean up admin/reports routes * Add Report#statuses method * DRY up current account action taken params * Rubocop styles
2017-04-13Organize coverage dirs (#1695)Matt Jankowski
* Add `Presenters` group to SimpleCov configuration * Move validators to app/validators, add to simplecov config
2017-04-13Fix csv export coverage in export spec (#1691)Matt Jankowski
2017-04-13Clean up well-known routes/controllers (#1649)Matt Jankowski
* Add request spec for host meta route returning xml * Add routing spec for xrd routes * Update well-known routes * Move webfinger and host-meta actions to their own controllers
2017-04-13Admin accounts controller cleanup (#1664)Matt Jankowski
* Remove unused account_params method in admin/accounts controller * Introduce AccountFilter to find accounts * Use AccountFilter in admin/accounts controller * Use more restful routes admin silence and suspension area * Add admin/silences and admin/suspensions controllers
2017-04-13Settings export refactor (#1646)Matt Jankowski
* Refactor Export to take an account and know about the export types * Use Export instance in settings/exports#show
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-13Fix tests issue introduced in #1607 (#1639)Eugen
2017-04-12Webfinger resource to extract username from resource string (#1607)Matt Jankowski
* Add WebfingerResource class to extract usernames * Use WebfingerResource in xrd#webfinger
2017-04-12Allow import/export of mutes list (#1541)Matt Jankowski
* Allow export of mutes list * Allow importing of mutes list * Refactor to use Settings::Exports::BaseController and DRY up exports code
2017-04-12Add unit tests for https://github.com/tootsuite/mastodon/pull/1574 (#1584)Henry Smith
2017-04-12Simplify the way the embed view is created (#1590)Matt Jankowski
* Add coverage for embedded status view * Refactor embed view to eliminate @external_links variable
2017-04-12Default to json type for webfinger requests (#1583)Matt Jankowski
2017-04-12Fix issue with intermittent api/v1/notifications failure (#1606)Matt Jankowski
The spec was checking the activity_id of the activities held in notifications within the controller. Because the activities are different models, it is possible that they are created with the same database IDs, and when they are this spec fails because an activity which should not count as a match is counted as one.
2017-04-11Refactor exports controller (#1567)Matt Jankowski
* Add basic coverage for settings/exports controller * Remove unused @account variable from settings/exports controller * Add coverage for download export actions * Remove deprecated `render :text` in favor of `send_data` for csv downloads * Add model to handle exports * Use Export class in settings/exports controller * Simplify settings/exports controller methods * Move settings/export to more restful routes
2017-04-11Imports controller errors (#1553)Matt Jankowski
* Add spec for settings/imports controller * Add failing spec for settings/imports#create * Fix broken imports * Refactor ImportWorker
2017-04-11Remove unused methods from StreamEntriesHelper (#1365)Matt Jankowski
Removes: - avatar_for_status_url - relative_time - reblogged_by_me_class - favourited_by_me_class
2017-04-11Remove unused AtomBuilderHelper (#1364)Matt Jankowski
This was used in the views/atom/user_stream.xml.ruby file, which no longer is used.
2017-04-11Pagination improvements (#1445)Matt Jankowski
* Replace will_paginate with kaminari * Use #page instead of #paginate in controllers * Replace will_paginate.page_gap with pagination.truncate in i18n * Customize kaminari views to match prior styles * Set kaminari options to match prior behavior * Replace will_paginate with paginate in views
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-10API param to exclude notification types from response (#1341)Eugen
* Add exclude_types param to /api/v1/notifications * Exclude notification types in web UI through exclude_types in the API
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-10Admin base controller (#1465)Matt Jankowski
* Add Admin::BaseController to wrap admin area Extracts the setting of the `admin` layout and verifying that users are admins to a common base class for the admin/ controllers. * Add basic coverage for admin/reports and admin/settings controllers
2017-04-09Fix /api/v1/accounts/update_credentials tests (#1357)Eugen
2017-04-09Allow users to update their Account in the API (#1179)David Celis
* Allow users to update their Account in the API It would be nice for API clients to be able to allow users to update their accounts without having to wrap Mastodon in a web view. This patch adds an API endpoint to let users submit a PATCH for their account. Signed-off-by: David Celis <me@davidcel.is> * Add /api/v1/accounts/update_credentials to the API docs Signed-off-by: David Celis <me@davidcel.is>
2017-04-09Helper cleanup (#1348)Matt Jankowski
* Remove unused helper files * Add coverage for application helper * Add coverage for StreamEntriesHelper #display_name
2017-04-09Clean up about page (#1282)Matt Jankowski
* Add InstancePresenter to expose site details * Clean up about controller, use instance presenter
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-09Ignore implied formats for catch all route requests (#1340)Matt Jankowski
A request to `/test` would show the custom 404 page, but a request to `/test.test` would return a 404 with an empty body. This change ignores the format on incoming catch all route requests, so that the html 404 page is returned on these requests.
2017-04-08Fix #1141, fix #1126 - Avatar/profile info fetching (#1215)Eugen
* Fix #1141, fix #1126 - Work through UpdateRemoteProfileService for both <feed> and <entry> top-level tags * Improve code quality, remove line unrelated to fix
2017-04-08Use Setting.site_title value for `og:site_name` occurrences (#1194)Matt Jankowski
* Add helper method to return Setting.site_title * Use site_title helper in application layout * Use site_title value for og:site_name
2017-04-07Merge pull request #1183 from thoughtbot/cp-post-status-service-specsEugen
Add specs for PostStatusService
2017-04-07Merge pull request #1184 from thoughtbot/extract-proper-statusEugen
DRY up reblog vs original status check
2017-04-07Implement pending specs on StatusJoël Quenneville
Implement the two pending specs on `Status`: `reblogs_count` and `favourites_count`.
2017-04-07Use I18n for media attachment validation errorsChad Pytel
These are currently user facing errors, but are not localized. This adds the ability for these messages to be localized.
2017-04-07Add specs for PostStatusServiceChad Pytel
This implements all pending specs, and adds additional coverage for the following functionality: * Normal status creation * Creating a reply status * Creating a sensitive status * Creating a status with spoiler text * A status with no spoiler text gets an empty string for spoiler text * Creating a status with custom visibility * Creating a status for an application * Processing mentions * Processing Hashtags * Pinging PuSH hubs * Crawling links * Attaching media
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-07Add specs for media attachment validationsChad Pytel
There are currently not specs for the two media validations that are performed by `PostStatusService`. This adds specs for the validations that ensure that you cannot attach more than four files, and that a status cannot have both image and video attachments.