2023-08-03 19:25:47 +10: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 20:15:21 +10:00
|
|
|
it 'returns http success and includes supported languages' do
|
2023-08-03 19:25:47 +10:00
|
|
|
expect(response).to have_http_status(200)
|
2024-09-20 23:13:04 +10:00
|
|
|
expect(response.content_type)
|
|
|
|
.to start_with('application/json')
|
2024-09-06 19:58:46 +10:00
|
|
|
expect(response.parsed_body.pluck(:code)).to match_array LanguagesHelper::SUPPORTED_LOCALES.keys.map(&:to_s)
|
2023-08-03 19:25:47 +10:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|