chinwagsocial/spec
Patrick Figel 8ac7fca5d0 Set correct attachment type for rejected media (#2599)
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-29 00:18:32 +02:00
..
controllers More controller specs (#2561) 2017-04-28 15:12:37 +02:00
fabricators More status specs (#2564) 2017-04-28 15:10:41 +02:00
features Introduce capybara and first feature spec (#1801) 2017-04-15 01:21:02 +02:00
fixtures Punycode URI normalization (#2370) 2017-04-25 02:47:31 +02:00
helpers Ensure i18n matches options (#2358) 2017-04-23 19:09:52 +02:00
javascript Add unit tests for https://github.com/tootsuite/mastodon/pull/1574 (#1584) 2017-04-12 17:16:59 +02:00
lib Decodes URL containing IDN (#2436) 2017-04-25 15:03:51 +02:00
mailers Add digest e-mails 2017-03-04 00:00:48 +01:00
models More status specs (#2564) 2017-04-28 15:10:41 +02:00
presenters About page contact email (#1839) 2017-04-15 13:33:25 +02:00
requests Restful refactor of accounts/ routes (#2133) 2017-04-19 13:52:37 +02:00
routing Restful refactor of accounts/ routes (#2133) 2017-04-19 13:52:37 +02:00
services Set correct attachment type for rejected media (#2599) 2017-04-29 00:18:32 +02:00
support/matchers/model add more tests to models 2017-04-05 00:29:56 +02:00
views Fix broken view spec for about/links (#2591) 2017-04-28 17:54:03 +02:00
rails_helper.rb Followers-only post federation (#2111) 2017-04-24 00:38:37 +02:00
spec_helper.rb Add more tests for AtomSerializer (#2096) 2017-04-18 22:30:17 +02:00