languages_spec.rb 453 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Languages' do
  4. describe 'GET /api/v1/instance/languages' do
  5. before do
  6. get '/api/v1/instance/languages'
  7. end
  8. it 'returns http success' do
  9. expect(response).to have_http_status(200)
  10. end
  11. it 'returns the supported languages' do
  12. expect(body_as_json.pluck(:code)).to match_array LanguagesHelper::SUPPORTED_LOCALES.keys.map(&:to_s)
  13. end
  14. end
  15. end