* Fix: #162 フォローしていないアカウントへのメンションのNGワードが編集で有効にならない問題 * Fix: 他のサーバーから来た編集についても適用
This commit is contained in:
parent
5497e2ae5d
commit
4f37ede886
6 changed files with 315 additions and 9 deletions
|
@ -510,6 +510,26 @@ RSpec.describe PostStatusService, type: :service do
|
|||
expect(status).to be_persisted
|
||||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'using hashtag under limit' do
|
||||
account = Fabricate(:account)
|
||||
text = '#a #b'
|
||||
Form::AdminSettings.new(post_hash_tags_max: 2).save
|
||||
|
||||
status = subject.call(account, text: text)
|
||||
|
||||
expect(status).to be_persisted
|
||||
expect(status.tags.count).to eq 2
|
||||
expect(status.text).to eq text
|
||||
end
|
||||
|
||||
it 'using hashtag over limit' do
|
||||
account = Fabricate(:account)
|
||||
text = '#a #b #c'
|
||||
Form::AdminSettings.new(post_hash_tags_max: 2).save
|
||||
|
||||
expect { subject.call(account, text: text) }.to raise_error Mastodon::ValidationError
|
||||
end
|
||||
end
|
||||
|
||||
def create_status_with_options(**options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue