diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/features/profiles/user_edit_preferences_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/features/profiles/user_edit_preferences_spec.rb')
-rw-r--r-- | spec/features/profiles/user_edit_preferences_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/features/profiles/user_edit_preferences_spec.rb b/spec/features/profiles/user_edit_preferences_spec.rb index d489d92c524..3129e4bd952 100644 --- a/spec/features/profiles/user_edit_preferences_spec.rb +++ b/spec/features/profiles/user_edit_preferences_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -RSpec.describe 'User edit preferences profile' do +RSpec.describe 'User edit preferences profile', :js do let(:user) { create(:user) } before do @@ -53,7 +53,14 @@ RSpec.describe 'User edit preferences profile' do fill_in 'Tab width', with: -1 click_button 'Save changes' - expect(page).to have_content('Failed to save preferences') + field = page.find_field('user[tab_width]') + message = field.native.attribute("validationMessage") + expect(message).to eq "Value must be greater than or equal to 1." + + # User trying to hack an invalid value + page.execute_script("document.querySelector('#user_tab_width').setAttribute('min', '-1')") + click_button 'Save changes' + expect(page).to have_content('Failed to save preferences.') end end |