Skip to content

Commit

Permalink
fixup! Fix track alerts, add user's locale
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-griffen committed Jan 12, 2024
1 parent c0aba99 commit c34265b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def set_gettext_locale

locale = AlaveteliLocalization.set_session_locale(
params[:locale],
current_user&.locale, # FIXME: Do we really want to use the user locale, or prioritise the session?

Check warning on line 79 in app/controllers/application_controller.rb

View workflow job for this annotation

GitHub Actions / build

[rubocop] reported by reviewdog 🐶 Line is too long. [105/80] (https://rubystyle.guide#max-line-length) Raw Output: app/controllers/application_controller.rb:79:81: C: Layout/LineLength: Line is too long. [105/80] (https://rubystyle.guide#max-line-length)
session[:locale],
cookies[:locale],
browser_locale,
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/track_alerts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
other_user = FactoryBot.create(:user)
other_user_session = login(other_user)
using_session(other_user_session) do
visit "en/annotate/request/#{info_request.url_title}"
visit "annotate/request/#{info_request.url_title}"
fill_in "comment[body]", with: 'test comment'
click_button 'Preview your annotation'
click_button 'Post annotation'
Expand Down Expand Up @@ -67,7 +67,7 @@
locale: 'es')
user_session = login(user)
using_session(user_session) do
visit "es/request/#{info_request.url_title}/track"
visit "request/#{info_request.url_title}/track"
end

other_user = FactoryBot.create(:user, locale: 'en')
Expand Down

0 comments on commit c34265b

Please sign in to comment.