2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
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
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
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
|
2023-07-09 08:55:56 +05:30
|
|
|
|
|
|
|
describe '#security_policy_bot?' do
|
|
|
|
subject { PolicyActorTestClass.new.security_policy_bot? }
|
|
|
|
|
|
|
|
it { is_expected.to eq(false) }
|
|
|
|
end
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|