diff options
Diffstat (limited to 'spec/features/profiles')
4 files changed, 17 insertions, 40 deletions
diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb index ca888018cad..6270fa7347d 100644 --- a/spec/features/profiles/chat_names_spec.rb +++ b/spec/features/profiles/chat_names_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' RSpec.describe 'Profile > Chat' do let(:user) { create(:user) } - let(:service) { create(:service) } + let(:integration) { create(:service) } before do sign_in(user) @@ -15,7 +15,7 @@ RSpec.describe 'Profile > Chat' do { team_id: 'T00', team_domain: 'my_chat_team', user_id: 'U01', user_name: 'my_chat_user' } end - let!(:authorize_url) { ChatNames::AuthorizeUserService.new(service, params).execute } + let!(:authorize_url) { ChatNames::AuthorizeUserService.new(integration, params).execute } let(:authorize_path) { URI.parse(authorize_url).request_uri } before do @@ -60,7 +60,7 @@ RSpec.describe 'Profile > Chat' do end describe 'visits chat accounts' do - let!(:chat_name) { create(:chat_name, user: user, service: service) } + let!(:chat_name) { create(:chat_name, user: user, integration: integration) } before do visit profile_chat_names_path diff --git a/spec/features/profiles/user_edit_preferences_spec.rb b/spec/features/profiles/user_edit_preferences_spec.rb index 3129e4bd952..c724de04043 100644 --- a/spec/features/profiles/user_edit_preferences_spec.rb +++ b/spec/features/profiles/user_edit_preferences_spec.rb @@ -1,10 +1,16 @@ # frozen_string_literal: true + require 'spec_helper' RSpec.describe 'User edit preferences profile', :js do + include StubLanguagesTranslationPercentage + + # Empty value doesn't change the levels + let(:language_percentage_levels) { nil } let(:user) { create(:user) } before do + stub_languages_translation_percentage(language_percentage_levels) stub_feature_flags(user_time_settings: true) sign_in(user) visit(profile_preferences_path) @@ -63,17 +69,4 @@ RSpec.describe 'User edit preferences profile', :js do expect(page).to have_content('Failed to save preferences.') end end - - describe 'User language' do - let(:user) { create(:user, preferred_language: :es) } - - it 'shows the user preferred language by default' do - expect(page).to have_select( - 'user[preferred_language]', - selected: 'Spanish - espaƱol', - options: Gitlab::I18n.selectable_locales.values, - visible: :all - ) - end - end end diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb index 57f7c7878e3..dddca15ae24 100644 --- a/spec/features/profiles/user_edit_profile_spec.rb +++ b/spec/features/profiles/user_edit_profile_spec.rb @@ -232,17 +232,6 @@ RSpec.describe 'User edit profile' do expect(page.find('.issuable-assignees')).to have_content("#{user.name} (Busy)") end end - - context 'with set_user_availability_status feature flag disabled' do - before do - stub_feature_flags(set_user_availability_status: false) - visit root_path(user) - end - - it 'does not display the availability checkbox' do - expect(page).not_to have_css('[data-testid="user-availability-checkbox"]') - end - end end context 'user menu' do @@ -487,19 +476,6 @@ RSpec.describe 'User edit profile' do expect(first_note).not_to have_css('.user-status-emoji') end end - - context 'with set_user_availability_status feature flag disabled' do - before do - stub_feature_flags(set_user_availability_status: false) - visit root_path(user) - end - - it 'does not display the availability checkbox' do - open_user_status_modal - - expect(page).not_to have_css('[data-testid="user-availability-checkbox"]') - end - end end context 'User time preferences', :js do diff --git a/spec/features/profiles/user_visits_notifications_tab_spec.rb b/spec/features/profiles/user_visits_notifications_tab_spec.rb index 939e791c75d..e960cc76219 100644 --- a/spec/features/profiles/user_visits_notifications_tab_spec.rb +++ b/spec/features/profiles/user_visits_notifications_tab_spec.rb @@ -12,6 +12,14 @@ RSpec.describe 'User visits the notifications tab', :js do visit(profile_notifications_path) end + it 'turns on the receive product marketing emails setting' do + expect(page).to have_content('Notifications') + + expect do + check 'Receive product marketing emails' + end.to change { user.reload.email_opted_in }.to(true) + end + it 'changes the project notifications setting' do expect(page).to have_content('Notifications') |