2023-08-03 09:25:47 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Languages' do
|
|
|
|
describe 'GET /api/v1/instance/languages' do
|
|
|
|
before do
|
|
|
|
get '/api/v1/instance/languages'
|
|
|
|
end
|
|
|
|
|
2024-09-19 10:15:21 +00:00
|
|
|
it 'returns http success and includes supported languages' do
|
2023-08-03 09:25:47 +00:00
|
|
|
expect(response).to have_http_status(200)
|
2024-09-20 13:13:04 +00:00
|
|
|
expect(response.content_type)
|
|
|
|
.to start_with('application/json')
|
2024-09-06 09:58:46 +00:00
|
|
|
expect(response.parsed_body.pluck(:code)).to match_array LanguagesHelper::SUPPORTED_LOCALES.keys.map(&:to_s)
|
2023-08-03 09:25:47 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|