docbrown/spec/policies/html_variant_policy_spec.rb
rhymes 6553f08d94 Rubocop cleanups (#1415)
* Update rubocop-todo.yml with new violations

* Fix Layout/EmptyLine* rules

* Fix Layout/Indentation* rules

* Fix remaining Layout/* rules

* Fix Lint/DuplicateMethods by removing unused accessor

* Fix Lint/IneffectiveAccessModifier

* Fix Lint/MissingCopEnableDirective

* Re-run rubocop auto gen config

* Fix Layout/RescueEnsureAlignment

* Fix Naming/* rules

* Fix some RSpec/* rules

* Fix typos

* Fix RSpec/LetBeforeExamples

* Series should only be an attr_writer, not an attr_accessor

* Fix RSpec/InstanceVariable

* Fix RSpec/InstanceVariable

* Fix RSpec/RepeatedDescription and RSpec/RepeatedExample

* Fix Style/ClassAndModuleChildren

* Fix Style/ConditionalAssignment

* Fix some Style/* rules

* Trigger Travis CI build because failing tests are not failing locally

* Revert "Fix Style/ClassAndModuleChildren"

This reverts commit 1686801d8a1516ba1894f79e24401a20dea65f99.
2019-01-02 11:20:02 -05:00

19 lines
538 B
Ruby

require "rails_helper"
RSpec.describe HtmlVariantPolicy do
subject { described_class.new(user, html_variant) }
context "when user is not an admin" do
let(:user) { build(:user) }
let(:html_variant) { build(:html_variant) }
it { is_expected.to forbid_actions(%i[index show edit update create]) }
end
context "when user is an admin" do
let(:user) { build(:user, :super_admin) }
let(:html_variant) { build(:html_variant) }
it { is_expected.to permit_actions(%i[index show edit update create]) }
end
end