Merge upstream 2.0ish #165
This commit is contained in:
5
spec/models/account_moderation_note_spec.rb
Normal file
5
spec/models/account_moderation_note_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AccountModerationNote, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
21
spec/models/email_domain_block_spec.rb
Normal file
21
spec/models/email_domain_block_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe EmailDomainBlock, type: :model do
|
||||
describe 'validations' do
|
||||
it 'has a valid fabricator' do
|
||||
email_domain_block = Fabricate.build(:email_domain_block)
|
||||
expect(email_domain_block).to be_valid
|
||||
end
|
||||
end
|
||||
|
||||
describe 'block?' do
|
||||
it 'returns true if the domain is registed' do
|
||||
Fabricate(:email_domain_block, domain: 'example.com')
|
||||
expect(EmailDomainBlock.block?('nyarn@example.com')).to eq true
|
||||
end
|
||||
it 'returns true if the domain is not registed' do
|
||||
Fabricate(:email_domain_block, domain: 'domain')
|
||||
expect(EmailDomainBlock.block?('example')).to eq false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -9,7 +9,7 @@ RSpec.describe Feed, type: :model do
|
||||
Fabricate(:status, account: account, id: 3)
|
||||
Fabricate(:status, account: account, id: 10)
|
||||
Redis.current.zadd(FeedManager.instance.key(:home, account.id),
|
||||
[[4, 'deleted'], [3, 'val3'], [2, 'val2'], [1, 'val1']])
|
||||
[[4, 4], [3, 3], [2, 2], [1, 1]])
|
||||
|
||||
feed = Feed.new(:home, account)
|
||||
results = feed.get(3)
|
||||
|
||||
@@ -17,7 +17,6 @@ RSpec.describe MediaAttachment, type: :model do
|
||||
expect(media.file.meta["original"]["height"]).to eq 128
|
||||
expect(media.file.meta["original"]["aspect"]).to eq 1.0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'non-animated gif non-conversion' do
|
||||
@@ -50,4 +49,12 @@ RSpec.describe MediaAttachment, type: :model do
|
||||
expect(media.file.meta["small"]["aspect"]).to eq 400.0/267
|
||||
end
|
||||
end
|
||||
|
||||
describe 'descriptions for remote attachments' do
|
||||
it 'are cut off at 140 characters' do
|
||||
media = Fabricate(:media_attachment, description: 'foo' * 1000, remote_url: 'http://example.com/blah.jpg')
|
||||
|
||||
expect(media.description.size).to be <= 420
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user