Commit a47e7c0e authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'refactor-user-specs' into 'master'

Refactor duplicate specs in user model specs

See merge request gitlab-org/gitlab!28450
parents d2e4e914 0545c194
......@@ -414,7 +414,6 @@ RSpec/RepeatedExample:
- 'spec/models/concerns/issuable_spec.rb'
- 'spec/models/member_spec.rb'
- 'spec/models/project_services/chat_message/pipeline_message_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/models/wiki_page_spec.rb'
- 'spec/routing/admin_routing_spec.rb'
- 'spec/rubocop/cop/migration/update_large_table_spec.rb'
......
---
title: Remove repeated examples in user model specs
merge_request: 28450
author: Rajendra Kadam
type: changed
......@@ -3681,15 +3681,15 @@ describe User, :do_not_mock_admin_mode do
end
it 'returns false if email can not be synced' do
stub_omniauth_setting(sync_profile_attributes: %w(location email))
stub_omniauth_setting(sync_profile_attributes: %w(location name))
expect(user.sync_attribute?(:name)).to be_falsey
expect(user.sync_attribute?(:email)).to be_falsey
end
it 'returns false if location can not be synced' do
stub_omniauth_setting(sync_profile_attributes: %w(location email))
stub_omniauth_setting(sync_profile_attributes: %w(name email))
expect(user.sync_attribute?(:name)).to be_falsey
expect(user.sync_attribute?(:location)).to be_falsey
end
it 'returns true for all syncable attributes if all syncable attributes can be synced' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment