Sha256: fa4a74e8c91b8a03125fcfa16179501394b81927512e080a13dedd0b86c0dc3d
Contents?: true
Size: 664 Bytes
Versions: 1
Compression:
Stored size: 664 Bytes
Contents
describe ArticleCategoryPolicy do subject { described_class.new(user, article) } let(:article) { FactoryBot.create(:article) } context "being a normal" do let(:user) { FactoryBot.create(:user) } it { is_expected.to(permit_actions(%i[index show])) } it { is_expected.to(forbid_actions(%i[create update delete])) } end context "being a user" do let(:user) { FactoryBot.create(:user, roles: :user) } it { is_expected.to(permit_actions(%i[create update])) } end context "being an admin" do let(:user) { FactoryBot.create(:user, roles: :admin) } it { is_expected.to(permit_actions(%i[create update delete])) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
souls-0.24.2 | apps/api/spec/policies/article_category_policy_spec.rb |