2022-07-16 23:28:13 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
RSpec.describe PwaController, feature_category: :navigation do
|
2022-07-23 23:45:48 +05:30
|
|
|
describe 'GET #manifest' do
|
|
|
|
it 'responds with json' do
|
|
|
|
get manifest_path(format: :json)
|
|
|
|
|
|
|
|
expect(response.body).to include('The complete DevOps platform.')
|
|
|
|
expect(response).to have_gitlab_http_status(:success)
|
|
|
|
end
|
2023-03-04 22:38:38 +05:30
|
|
|
|
|
|
|
context 'with customized appearance' do
|
|
|
|
let_it_be(:appearance) do
|
|
|
|
create(:appearance, title: 'Long name', short_title: 'Short name', description: 'This is a test')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'uses custom values', :aggregate_failures do
|
|
|
|
get manifest_path(format: :json)
|
|
|
|
|
|
|
|
expect(Gitlab::Json.parse(response.body)).to include({
|
|
|
|
'description' => 'This is a test',
|
|
|
|
'name' => 'Long name',
|
|
|
|
'short_name' => 'Short name'
|
|
|
|
})
|
|
|
|
expect(response).to have_gitlab_http_status(:success)
|
|
|
|
end
|
|
|
|
end
|
2022-07-23 23:45:48 +05:30
|
|
|
end
|
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
describe 'GET #offline' do
|
|
|
|
it 'responds with static HTML page' do
|
|
|
|
get offline_path
|
|
|
|
|
|
|
|
expect(response.body).to include('You are currently offline')
|
|
|
|
expect(response).to have_gitlab_http_status(:success)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|