mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-13 01:01:27 -05:00
f2ddd44712
The opensearch.xml results in a "site search engine" being added to Chrome, while the sitelinks search tag results in "Search this website" being added to Google Search.
28 lines
876 B
Ruby
28 lines
876 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe MetadataController do
|
|
describe 'manifest.json' do
|
|
it 'returns the right output' do
|
|
title = 'MyApp'
|
|
SiteSetting.title = title
|
|
get :manifest
|
|
expect(response.body).to include(title)
|
|
expect(response.content_type).to eq('application/json')
|
|
end
|
|
end
|
|
|
|
describe 'opensearch.xml' do
|
|
it 'returns the right output' do
|
|
title = 'MyApp'
|
|
favicon_path = '/uploads/something/23432.png'
|
|
SiteSetting.title = title
|
|
SiteSetting.favicon_url = favicon_path
|
|
get :opensearch, format: :xml
|
|
expect(response.body).to include(title)
|
|
expect(response.body).to include("/search?q={searchTerms}")
|
|
expect(response.body).to include('image/png')
|
|
expect(response.body).to include(favicon_path)
|
|
expect(response.content_type).to eq('application/xml')
|
|
end
|
|
end
|
|
end
|