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