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

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

30 lines
744 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/project', feature_category: :projects do
let(:invite_member) { true }
before do
allow(view).to receive(:can_admin_project_member?).and_return(invite_member)
assign(:project, build_stubbed(:project))
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