Merge branch 'kb-draft-5.3-lts' into kb-draft-7.0
This commit is contained in:
commit
16f8e73f02
2 changed files with 38 additions and 0 deletions
32
spec/serializers/nodeinfo/serializer_spec.rb
Normal file
32
spec/serializers/nodeinfo/serializer_spec.rb
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe NodeInfo::Serializer do # rubocop:disable RSpec/FilePath
|
||||||
|
let(:serialization) do
|
||||||
|
JSON.parse(
|
||||||
|
ActiveModelSerializers::SerializableResource.new(
|
||||||
|
record, adapter: NodeInfo::Adapter, serializer: described_class, root: 'nodeinfo'
|
||||||
|
).to_json
|
||||||
|
)
|
||||||
|
end
|
||||||
|
let(:record) { {} }
|
||||||
|
|
||||||
|
describe 'nodeinfo version' do
|
||||||
|
it 'returns 2.0' do
|
||||||
|
expect(serialization['version']).to eq '2.0'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'mastodon version' do
|
||||||
|
it 'contains kmyblue' do
|
||||||
|
expect(serialization['software']['version'].include?('kmyblue')).to be true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'metadata' do
|
||||||
|
it 'returns features' do
|
||||||
|
expect(serialization['metadata']['features']).to include 'emoji_reaction'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -17,4 +17,10 @@ describe REST::InstanceSerializer do
|
||||||
expect(serialization['usage']).to eq({ 'users' => { 'active_month' => 0 } })
|
expect(serialization['usage']).to eq({ 'users' => { 'active_month' => 0 } })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'fedibird_capabilities' do
|
||||||
|
it 'returns fedibird_capabilities' do
|
||||||
|
expect(serialization['fedibird_capabilities']).to include 'emoji_reaction'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue