Browse Source

Removing default avatars

pull/4/head
Eugen Rochko 6 years ago
parent
commit
a4cc966476
4 changed files with 2 additions and 2 deletions
  1. BIN
     
  2. BIN
     
  3. +1
    -1
      app/models/account.rb
  4. +1
    -1
      spec/helpers/atom_builder_helper_spec.rb

BIN
View File


BIN
View File


+ 1
- 1
app/models/account.rb View File

@ -7,7 +7,7 @@ class Account < ApplicationRecord
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
# Avatar upload
has_attached_file :avatar, styles: { large: '300x300#', medium: '96x96#', small: '48x48#' }, default_url: 'avatars/missing.png'
has_attached_file :avatar, styles: { large: '300x300#', medium: '96x96#', small: '48x48#' }
validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\Z/
# Header upload

+ 1
- 1
spec/helpers/atom_builder_helper_spec.rb View File

@ -170,7 +170,7 @@ RSpec.describe AtomBuilderHelper, type: :helper do
let(:account) { Fabricate(:account, username: 'alice') }
it 'creates a link' do
expect(used_with_namespaces { |xml| helper.link_avatar(xml, account) }).to match '<link rel="avatar" type="" media:width="300" media:height="300" href="http://test.host/assets/avatars/missing.png"/>'
expect(used_with_namespaces { |xml| helper.link_avatar(xml, account) }).to match '<link rel="avatar" type="" media:width="300" media:height="300" href="http://test.host/avatars/large/missing.png"/>'
end
end

Loading…
Cancel
Save