14988: Fixes assert_equal param ordering for proper error messages.
[arvados.git] / apps / workbench / test / integration / user_profile_test.rb
index 59a1203051fbc8f12d76ad1a4f976148db832baf..e4d9894e5fb4e902f90dffc4019e2a771722cd37 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 require 'integration_helper'
 
 class UserProfileTest < ActionDispatch::IntegrationTest
@@ -96,10 +100,11 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     required_field_title = ''
     required_field_key = ''
     profile_config = Rails.configuration.user_profile_form_fields
-    profile_config.andand.each do |entry|
+    profile_config.each do |entry|
       if entry['required']
         required_field_key = entry['key']
         required_field_title = entry['form_field_title']
+        break
       end
     end
 
@@ -111,6 +116,9 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     click_button "Save profile"
     # profile saved and in profile page now with success
     assert_text('Thank you for filling in your profile')
+    assert_selector('input' +
+                    '[name="user[prefs][profile]['+required_field_key+']"]' +
+                    '[value="value to fill required field"]')
     if user['prefs']['getting_started_shown']
       click_link 'Back to work!'
     else