We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0145656 commit bbe2579Copy full SHA for bbe2579
spec/controllers/application_controller_spec.rb
@@ -0,0 +1,18 @@
1
+require 'spec_helper'
2
+
3
+RSpec.describe ApplicationController do
4
+ describe '#switch_lang' do
5
+ before do
6
+ request.env["HTTP_REFERER"] = root_path
7
+ end
8
9
+ it 'switches locale to passed language via params' do
10
+ original_locale = I18n.locale
11
+ new_locale = :ca
12
13
+ expect do
14
+ get :switch_lang, locale: new_locale
15
+ end.to change(I18n, :locale).from(original_locale).to(new_locale)
16
17
18
+end
0 commit comments