Add: _misskey_licenseの送受信 (#968)

This commit is contained in:
KMY(雪あすか) 2025-01-23 18:50:38 +09:00 committed by GitHub
parent 9c14810881
commit c139f8947e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 110 additions and 3 deletions

View file

@ -0,0 +1,53 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe ActivityPub::Parser::CustomEmojiParser do
subject { described_class.new(json) }
context 'with fedibird license' do
let(:json) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: ['https://example.com/#foo'].join,
name: 'ohagi',
license: 'Ohagi is ohagi',
}.with_indifferent_access
end
it 'load license' do
expect(subject.license).to eq 'Ohagi is ohagi'
end
end
context 'with misskey license' do
let(:json) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: ['https://example.com/#foo'].join,
name: 'ohagi',
_misskey_license: {
freeText: 'Ohagi is ohagi',
},
}.with_indifferent_access
end
it 'load license' do
expect(subject.license).to eq 'Ohagi is ohagi'
end
end
context 'without license' do
let(:json) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: ['https://example.com/#foo'].join,
name: 'ohagi',
}.with_indifferent_access
end
it 'do not load license' do
expect(subject.license).to be_nil
end
end
end