diff options
Diffstat (limited to 'spec/helpers/nav_helper_spec.rb')
-rw-r--r-- | spec/helpers/nav_helper_spec.rb | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/spec/helpers/nav_helper_spec.rb b/spec/helpers/nav_helper_spec.rb index 9a0f72838fb..e8b68d80650 100644 --- a/spec/helpers/nav_helper_spec.rb +++ b/spec/helpers/nav_helper_spec.rb @@ -134,68 +134,4 @@ RSpec.describe NavHelper, feature_category: :navigation do it { is_expected.to eq(true) } end end - - describe '#show_super_sidebar?' do - shared_examples 'show_super_sidebar is supposed to' do - before do - user.update!(use_new_navigation: user_preference) - end - - context 'when user has not interacted with the new nav toggle yet' do - let(:user_preference) { nil } - - specify { expect(subject).to eq true } - end - - context 'when user has new nav disabled' do - let(:user_preference) { false } - - specify { expect(subject).to eq true } - end - - context 'when user has new nav enabled' do - let(:user_preference) { true } - - specify { expect(subject).to eq true } - end - end - - context 'without a user' do - context 'with current_user (nil) as a default' do - before do - allow(helper).to receive(:current_user).and_return(nil) - end - - subject { helper.show_super_sidebar? } - - specify { expect(subject).to eq true } - end - - context 'with nil provided as an argument' do - subject { helper.show_super_sidebar?(nil) } - - specify { expect(subject).to eq true } - end - end - - context 'when user is signed-in' do - let_it_be(:user) { create(:user) } - - context 'with current_user as a default' do - before do - allow(helper).to receive(:current_user).and_return(user) - end - - subject { helper.show_super_sidebar? } - - it_behaves_like 'show_super_sidebar is supposed to' - end - - context 'with user provided as an argument' do - subject { helper.show_super_sidebar?(user) } - - it_behaves_like 'show_super_sidebar is supposed to' - end - end - end end |