spec/policies/archangel/site_policy_spec.rb in archangel-0.0.5 vs spec/policies/archangel/site_policy_spec.rb in archangel-0.0.6
- old
+ new
@@ -4,27 +4,29 @@
module Archangel
RSpec.describe SitePolicy, type: :policy do
subject { described_class.new(user, record) }
- let(:user) { create(:user) }
let(:record) { create(:site) }
- it { should permit(:show) }
-
context "with `admin` role" do
let(:user) { create(:user, :admin) }
- it { should permit(:update) }
- it { should permit(:edit) }
- it { should permit(:sample) }
+ it { is_expected.to permit(:show) }
+ it { is_expected.to permit(:update) }
+ it { is_expected.to permit(:edit) }
+
+ it { is_expected.to permit(:sample) }
end
context "with `editor` role" do
let(:user) { create(:user, :editor) }
- it { should_not permit(:update) }
- it { should_not permit(:edit) }
- it { should permit(:sample) }
+ it { is_expected.to permit(:show) }
+
+ it { is_expected.to permit(:sample) }
+
+ it { is_expected.to_not permit(:update) }
+ it { is_expected.to_not permit(:edit) }
end
end
end