Refactored generation of unique tags, URIs and object URLs into own classes,
as well as formatting of content
This commit is contained in:
parent
735b4cc62e
commit
3cc47beb6e
28 changed files with 316 additions and 180 deletions
|
@ -20,7 +20,7 @@ RSpec.describe AtomBuilderHelper, type: :helper do
|
|||
describe '#unique_id' do
|
||||
it 'creates an id' do
|
||||
time = Time.now
|
||||
expect(used_in_builder { |xml| helper.unique_id(xml, time, 1, 'Status') }).to match "<id>#{helper.unique_tag(time, 1, 'Status')}</id>"
|
||||
expect(used_in_builder { |xml| helper.unique_id(xml, time, 1, 'Status') }).to match "<id>#{TagManager.instance.unique_tag(time, 1, 'Status')}</id>"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -146,18 +146,10 @@ RSpec.describe AtomBuilderHelper, type: :helper do
|
|||
let(:account) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
it 'creates a link' do
|
||||
expect(used_in_builder { |xml| helper.link_mention(xml, account) }).to match '<link rel="mentioned" href="http://test.host/users/alice"/>'
|
||||
expect(used_in_builder { |xml| helper.link_mention(xml, account) }).to match '<link rel="mentioned" href="https://cb6e6126.ngrok.io/users/alice"/>'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#disambiguate_uri' do
|
||||
pending
|
||||
end
|
||||
|
||||
describe '#disambiguate_url' do
|
||||
pending
|
||||
end
|
||||
|
||||
describe '#include_author' do
|
||||
pending
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue