if !user
assert_text('Please log in')
elsif user['is_active']
- if profile_config && !has_profile
+ if !profile_config.empty? && !has_profile
assert_text('Save profile')
add_profile user
else
- assert_text('Recent pipelines and processes')
+ assert_text('Recent processes')
assert_no_text('Save profile')
end
elsif invited
assert_selector('a', text: 'Current token')
assert_selector('a', text: 'SSH keys')
- if profile_config
+ if !profile_config.empty?
assert_selector('a', text: 'Manage profile')
else
assert_no_selector('a', text: 'Manage profile')
required_field_title = ''
required_field_key = ''
profile_config = Rails.configuration.Workbench.UserProfileFormFields
- profile_config.each do |entry|
- if entry['required']
- required_field_key = entry['key']
- required_field_title = entry['form_field_title']
+ profile_config.each do |k, entry|
+ if entry['Required']
+ required_field_key = k.to_s
+ required_field_title = entry['FormFieldTitle']
break
end
end
end
# profile saved and in home page now
- assert_text('Recent pipelines and processes')
+ assert_text('Recent processes')
end
[
[true, false].each do |profile_required|
test "visit #{token} home page when profile is #{'not ' if !profile_required}configured" do
if !profile_required
- Rails.configuration.Workbench.UserProfileFormFields = false
+ Rails.configuration.Workbench.UserProfileFormFields = []
else
# Our test config enabled profile by default. So, no need to update config
end