Add GET /api/v1/instance/languages
to REST API (#24443)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com> Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
6b896b20cc
commit
3a4d3e9d4b
5 changed files with 66 additions and 0 deletions
19
spec/requests/api/v1/instances/languages_spec.rb
Normal file
19
spec/requests/api/v1/instances/languages_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
# 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
|
||||
|
||||
it 'returns http success' do
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
it 'returns the supported languages' do
|
||||
expect(body_as_json.pluck(:code)).to match_array LanguagesHelper::SUPPORTED_LOCALES.keys.map(&:to_s)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue