Add: #699 引用・参照対応サーバーをAPIで取得 (#711)

* Add: #699 引用・参照対応サーバーをAPIで取得

* Complete

* ごめん
This commit is contained in:
KMY(雪あすか) 2024-04-16 12:58:54 +09:00 committed by GitHub
parent 78b2707c08
commit 1c054ed3a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 129 additions and 29 deletions

View file

@ -3,8 +3,12 @@
require 'rails_helper'
RSpec.describe InstanceInfo do
describe '.emoji_reaction_availables_map' do
subject { described_class.emoji_reaction_available?('example.com') }
describe '.available_features' do
subject { described_class.available_features('example.com')[:emoji_reaction] }
it 'availables if local account' do
expect(described_class.available_features(nil)[:emoji_reaction]).to be true
end
it 'availables if features contains emoji_reaction' do
Fabricate(:instance_info, domain: 'example.com', software: 'mastodon', data: { metadata: { features: ['emoji_reaction'] } })

View file

@ -460,8 +460,8 @@ RSpec.describe Status do
end
end
describe '.emoji_reaction_availables_map' do
subject { described_class.emoji_reaction_availables_map(domains) }
describe '.available_features_map' do
subject { described_class.available_features_map(domains) }
let(:domains) { %w(features_available.com mastodon.com misskey.com) }
@ -472,15 +472,15 @@ RSpec.describe Status do
end
it 'availables if features contains emoji_reaction' do
expect(subject['features_available.com']).to be true
expect(subject['features_available.com'][:emoji_reaction]).to be true
end
it 'unavailables if mastodon server' do
expect(subject['mastodon.com']).to be false
expect(subject['mastodon.com'][:emoji_reaction]).to be false
end
it 'availables if misskey server' do
expect(subject['misskey.com']).to be true
expect(subject['misskey.com'][:emoji_reaction]).to be true
end
end