]> git.openstreetmap.org Git - rails.git/blobdiff - test/system/preferences_test.rb
Ensure that flash message is shown in the updated language
[rails.git] / test / system / preferences_test.rb
diff --git a/test/system/preferences_test.rb b/test/system/preferences_test.rb
new file mode 100644 (file)
index 0000000..e5bcd10
--- /dev/null
@@ -0,0 +1,23 @@
+require "application_system_test_case"
+
+class PreferencesTest < ApplicationSystemTestCase
+  def test_flash_message_shows_in_original_language
+    sign_in_as(create(:user))
+
+    visit edit_preferences_path
+    click_on "Update Preferences"
+
+    assert page.has_content?("Preferences updated")
+  end
+
+  def test_flash_message_shows_in_new_language
+    sign_in_as(create(:user))
+
+    visit edit_preferences_path
+    fill_in "Preferred Languages", :with => "fr"
+    click_on "Update Preferences"
+
+    # TODO: enable with french translation when that's available
+    # assert page.has_content?("Préférences mises à jour") # rubocop:disable Style/AsciiComments
+  end
+end