forked from mastodon/mastodon
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* スタンプ機能のリファクタリング、投稿の反応者へも配送 * Fix: 他のサーバーの絵文字を複数つけられる問題
- Loading branch information
Showing
2 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,15 +19,6 @@ | |
expect(subject.first.custom_emoji_id).to be_nil | ||
end | ||
|
||
context 'with name duplication on same account' do | ||
before { Fabricate(:emoji_reaction, status: status, name: '😀') } | ||
|
||
it 'react with emoji' do | ||
expect(subject.count).to eq 1 | ||
expect(subject.first.name).to eq '😀' | ||
end | ||
end | ||
|
||
context 'when multiple reactions by same account' do | ||
let(:name) { '😂' } | ||
|
||
|
@@ -139,6 +130,37 @@ | |
end | ||
end | ||
|
||
context 'with name duplication of unicode emoji on same account' do | ||
before { Fabricate(:emoji_reaction, status: status, name: '😀') } | ||
|
||
it 'react with emoji' do | ||
expect(subject.count).to eq 1 | ||
expect(subject.first.name).to eq '😀' | ||
end | ||
end | ||
|
||
context 'with name duplication of local cuetom emoji on same account' do | ||
let(:name) { 'ohagi' } | ||
let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi') } | ||
|
||
before { Fabricate(:emoji_reaction, account: sender, status: status, name: 'ohagi', custom_emoji: custom_emoji) } | ||
|
||
it 'react with emoji' do | ||
expect { subject.count }.to raise_error Mastodon::ValidationError | ||
end | ||
end | ||
|
||
context 'with name duplication of remote cuetom emoji on same account' do | ||
let(:name) { '[email protected]' } | ||
let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') } | ||
|
||
before { Fabricate(:emoji_reaction, account: sender, status: status, name: 'ohagi', custom_emoji: custom_emoji) } | ||
|
||
it 'react with emoji' do | ||
expect { subject.count }.to raise_error Mastodon::ValidationError | ||
end | ||
end | ||
|
||
context 'when has remote followers' do | ||
let!(:bob) { Fabricate(:account, domain: 'foo.bar', uri: 'https://foo.bar/actor', inbox_url: 'https://foo.bar/inbox', protocol: 'activitypub') } | ||
|
||
|