Welcome to mirror list, hosted at ThFree Co, Russian Federation.

policy_actor_spec.rb « concerns « policies « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7fd9db67032a9f71fccf9ea8b513519e3e79baaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe PolicyActor, feature_category: :shared do
  let(:policy_actor_test_class) do
    Class.new do
      include PolicyActor
    end
  end

  before do
    stub_const('PolicyActorTestClass', policy_actor_test_class)
  end

  it 'implements all the methods from user' do
    methods = subject.instance_methods

    # User.instance_methods do not return all methods until an instance is
    # initialized. So here we just use an instance
    expect(build(:user).methods).to include(*methods)
  end

  describe '#security_policy_bot?' do
    subject { PolicyActorTestClass.new.security_policy_bot? }

    it { is_expected.to eq(false) }
  end
end