+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
require 'integration_helper'
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
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