summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-05-25 10:22:45 -0500
committerRuben Davila <rdavila84@gmail.com>2017-05-25 10:22:45 -0500
commit5c921809cd86e1031a6a5075da142fef3bb01d6d (patch)
tree0c04cf9d24f9e94c2bf5dfd709c22f142bec5e77 /spec/mailers
parentd07e85e1033f8026f155c6171cb3ebcd6b93d9ed (diff)
downloadgitlab-ce-5c921809cd86e1031a6a5075da142fef3bb01d6d.tar.gz
Bugfix: Always use the default language when generating emails.32748-emails-are-being-sent-with-the-wrong-language
There was a race condition issue when the application was generating an email and was using a language that was previously being used in other request.
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notify_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 1e6260270fe..ec6f6c42eac 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -128,6 +128,15 @@ describe Notify do
is_expected.to have_body_text(namespace_project_issue_path(project.namespace, project, issue))
end
end
+
+ context 'with a preferred language' do
+ before { Gitlab::I18n.locale = :es }
+ after { Gitlab::I18n.use_default_locale }
+
+ it 'always generates the email using the default language' do
+ is_expected.to have_body_text('foo, bar, and baz')
+ end
+ end
end
describe 'status changed' do