debian-mirror-gitlab/spec/views/layouts/snippets.html.haml_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
774 B
Ruby
Raw Normal View History

2023-03-17 16:20:25 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-04-23 21:23:45 +05:30
RSpec.describe 'layouts/snippets', feature_category: :source_code_management do
2023-03-17 16:20:25 +05:30
before do
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
end
describe 'sidebar' do
2023-04-23 21:23:45 +05:30
context 'when signed in' do
let(:user) { build_stubbed(:user) }
2023-03-17 16:20:25 +05:30
2023-04-23 21:23:45 +05:30
it 'renders the "Your work" sidebar' do
render
2023-03-17 16:20:25 +05:30
2023-04-23 21:23:45 +05:30
expect(rendered).to have_css('aside.nav-sidebar[aria-label="Your work"]')
2023-03-17 16:20:25 +05:30
end
end
2023-04-23 21:23:45 +05:30
context 'when not signed in' do
let(:user) { nil }
2023-03-17 16:20:25 +05:30
it 'renders no sidebar' do
render
expect(rendered).not_to have_css('aside.nav-sidebar')
end
end
end
end