Skip to content
Snippets Groups Projects
Commit 2bb39368 authored by Kazushige Tominaga's avatar Kazushige Tominaga Committed by Yamagishi Kazutoshi
Browse files

Added #link_header spec (#6439)

parent 67f7ffa7
No related branches found
No related tags found
No related merge requests found
require 'rails_helper'
RSpec.describe FetchAtomService do
describe '#link_header' do
context 'Link is Array' do
target = FetchAtomService.new
target.instance_variable_set('@response', 'Link' => [
'<http://example.com/>; rel="up"; meta="bar"',
'<http://example.com/foo>; rel="self"',
])
it 'set first link as link_header' do
expect(target.send(:link_header).links[0].href).to eq 'http://example.com/'
end
end
context 'Link is not Array' do
target = FetchAtomService.new
target.instance_variable_set('@response', 'Link' => '<http://example.com/foo>; rel="self", <http://example.com/>; rel = "up"')
it { expect(target.send(:link_header).links[0].href).to eq 'http://example.com/foo' }
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment