diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/helpers/profiles_helper_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/helpers/profiles_helper_spec.rb')
-rw-r--r-- | spec/helpers/profiles_helper_spec.rb | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/spec/helpers/profiles_helper_spec.rb b/spec/helpers/profiles_helper_spec.rb index 2ea832f95dc..c3a3c2a0178 100644 --- a/spec/helpers/profiles_helper_spec.rb +++ b/spec/helpers/profiles_helper_spec.rb @@ -13,7 +13,8 @@ RSpec.describe ProfilesHelper do private_email = user.private_commit_email emails = [ - ["Use a private email - #{private_email}", Gitlab::PrivateCommitEmail::TOKEN], + [s_('Use primary email (%{email})') % { email: user.email }, ''], + [s_("Profiles|Use a private email - %{email}").html_safe % { email: private_email }, Gitlab::PrivateCommitEmail::TOKEN], user.email, confirmed_email1.email, confirmed_email2.email @@ -23,20 +24,6 @@ RSpec.describe ProfilesHelper do end end - describe '#selected_commit_email' do - let(:user) { create(:user) } - - it 'returns main email when commit email attribute is nil' do - expect(helper.selected_commit_email(user)).to eq(user.email) - end - - it 'returns DB stored commit_email' do - user.update!(commit_email: Gitlab::PrivateCommitEmail::TOKEN) - - expect(helper.selected_commit_email(user)).to eq(Gitlab::PrivateCommitEmail::TOKEN) - end - end - describe '#email_provider_label' do it "returns nil for users without external email" do user = create(:user) @@ -152,6 +139,22 @@ RSpec.describe ProfilesHelper do end end + describe '#middle_dot_divider_classes' do + using RSpec::Parameterized::TableSyntax + + where(:stacking, :breakpoint, :expected) do + nil | nil | %w(gl-mb-3 gl-display-inline-block middle-dot-divider) + true | nil | %w(gl-mb-3 middle-dot-divider-sm gl-display-block gl-sm-display-inline-block) + nil | :sm | %w(gl-mb-3 gl-display-inline-block middle-dot-divider-sm) + end + + with_them do + it 'returns CSS classes needed to render the middle dot divider' do + expect(helper.middle_dot_divider_classes(stacking, breakpoint)).to eq expected + end + end + end + def stub_cas_omniauth_provider provider = OpenStruct.new( 'name' => 'cas3', |