debian-mirror-gitlab/spec/lib/sidebars/projects/menus/members_menu_spec.rb
2021-06-08 01:23:25 +05:30

35 lines
837 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::MembersMenu do
let(:project) { build(:project) }
let(:user) { project.owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
describe '#render?' do
it 'returns false' do
expect(subject.render?).to eq false
end
context 'when feature flag :sidebar_refactor is disabled' do
before do
stub_feature_flags(sidebar_refactor: false)
end
it 'returns true' do
expect(subject.render?).to eq true
end
context 'when user cannot access members' do
let(:user) { nil }
it 'returns false' do
expect(subject.render?).to eq false
end
end
end
end
end