Refactor: インスタンスで利用可能な機能を検出する処理 (#721)
This commit is contained in:
parent
3af1b90795
commit
389ae9d339
2 changed files with 24 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe InstanceInfo do
|
||||
describe '.available_features' do
|
||||
describe '.available_features#emoji_reaction' do
|
||||
subject { described_class.available_features('example.com')[:emoji_reaction] }
|
||||
|
||||
it 'availables if local account' do
|
||||
|
@ -45,4 +45,18 @@ RSpec.describe InstanceInfo do
|
|||
expect(subject).to be false
|
||||
end
|
||||
end
|
||||
|
||||
describe '.available_features#circle' do
|
||||
subject { described_class.available_features('example.com')[:circle] }
|
||||
|
||||
it 'does not available if misskey server' do
|
||||
Fabricate(:instance_info, domain: 'example.com', software: 'misskey')
|
||||
expect(subject).to be false
|
||||
end
|
||||
|
||||
it 'availables if misskey server with features' do
|
||||
Fabricate(:instance_info, domain: 'example.com', software: 'misskey', data: { metadata: { features: ['circle'] } })
|
||||
expect(subject).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue