summaryrefslogtreecommitdiff
path: root/spec/policies/concerns/readonly_abilities_spec.rb
blob: 864924a091db954c1a93763d9496f187aa49b4bf (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ReadonlyAbilities do
  let(:test_class) do
    Class.new do
      include ReadonlyAbilities
    end
  end

  before do
    stub_const('TestClass', test_class)
  end

  describe '.readonly_abilities' do
    it 'returns an array of abilites to be prevented when readonly' do
      expect(TestClass.readonly_abilities).to include(*described_class::READONLY_ABILITIES)
    end
  end

  describe '.readonly_features' do
    it 'returns an array of features to be prevented when readonly' do
      expect(TestClass.readonly_features).to include(*described_class::READONLY_FEATURES)
    end
  end
end