Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

WP 53330, added use custom field to my_spec.rb, checked for LDAP user

Richard "Virgo" Richterdb3d5a5bc325
diff --git a/spec/features/users/my_spec.rb b/spec/features/users/my_spec.rb
index a8f0e33415f..500d91cd84c 100644
--- a/spec/features/users/my_spec.rb
+++ b/spec/features/users/my_spec.rb
@@ -30,6 +30,7 @@ require 'spec_helper'
RSpec.describe 'my', :js, :with_cuprite do
let(:user_password) { 'bob' * 4 }
+ let!(:string_cf) { create(:user_custom_field, :string, name: 'Hobbies', is_required: false) }
let(:user) do
create(:user,
@@ -435,7 +436,7 @@ RSpec.describe 'my', :js, :with_cuprite do
visit my_account_path
end
- it 'does not allow change of name and email but hide email can be changed' do
+ it 'does not allow change of name and email but other fields can be changed' do
email_field = find_field('user[mail]', disabled: true)
firstname_field = find_field('user[firstname]', disabled: true)
lastname_field = find_field('user[lastname]', disabled: true)
@@ -446,12 +447,14 @@ RSpec.describe 'my', :js, :with_cuprite do
expect(page).to have_text(I18n.t('user.text_change_disabled_for_ldap_login'), count: 3)
+ fill_in 'Hobbies', with: 'Ruby, DCS'
uncheck 'pref[hide_mail]'
click_on 'Save'
expect(page).to have_content I18n.t(:notice_account_updated)
user.reload
+ expect(user.custom_values.find_by(custom_field_id: string_cf).value).to eql 'Ruby, DCS'
expect(user.pref.hide_mail).to be false
end
end