mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 12:38:07 +08:00
Merge pull request #4010 from riking/patch-sitelinks
FEATURE: Add /search discovery
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ManifestJsonController do
|
||||
context 'index' do
|
||||
it 'returns the right output' do
|
||||
title = 'MyApp'
|
||||
SiteSetting.title = title
|
||||
get :index
|
||||
expect(response.body).to include(title)
|
||||
end
|
||||
end
|
||||
end
|
28
spec/controllers/metadata_controller_spec.rb
Normal file
28
spec/controllers/metadata_controller_spec.rb
Normal file
@ -0,0 +1,28 @@
|
||||
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
|
Reference in New Issue
Block a user