fix: Add missing switch_locale on DashboardController (#1631)
This commit is contained in:
parent
df27aab959
commit
a9344fbf4c
2 changed files with 17 additions and 3 deletions
|
@ -1,5 +1,9 @@
|
||||||
class DashboardController < ActionController::Base
|
class DashboardController < ActionController::Base
|
||||||
|
include SwitchLocale
|
||||||
|
|
||||||
before_action :set_global_config
|
before_action :set_global_config
|
||||||
|
around_action :switch_locale
|
||||||
|
|
||||||
layout 'vueapp'
|
layout 'vueapp'
|
||||||
|
|
||||||
def index; end
|
def index; end
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe '/app', type: :request do
|
describe '/app/login', type: :request do
|
||||||
describe 'GET /app' do
|
context 'without DEFAULT_LOCALE' do
|
||||||
it 'renders the dashboard' do
|
it 'renders the dashboard' do
|
||||||
get '/app'
|
get '/app/login'
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with DEFAULT_LOCALE' do
|
||||||
|
it 'renders the dashboard' do
|
||||||
|
ENV['DEFAULT_LOCALE'] = 'pt_BR'
|
||||||
|
get '/app/login'
|
||||||
|
expect(response).to have_http_status(:success)
|
||||||
|
expect(response.body).to include "selectedLocale: 'pt_BR'"
|
||||||
|
ENV['DEFAULT_LOCALE'] = 'en'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue