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

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

31 lines
804 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# 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