debian-mirror-gitlab/spec/views/layouts/group.html.haml_spec.rb
2023-05-27 22:25:52 +05:30

30 lines
804 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/group', feature_category: :subgroups do
let_it_be(:group) { create(:group) } # rubocop:todo RSpec/FactoryBot/AvoidCreate
let(:invite_member) { true }
before do
allow(view).to receive(:can_admin_group_member?).and_return(invite_member)
assign(:group, group)
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(build_stubbed(:user)))
end
subject do
render
rendered
end
context 'with ability to invite members' do
it { is_expected.to have_selector('.js-invite-members-modal') }
end
context 'without ability to invite members' do
let(:invite_member) { false }
it { is_expected.not_to have_selector('.js-invite-members-modal') }
end
end