This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
2019-02-01 21:36:10 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe AccountPolicy do
|
|
|
|
subject { described_class.new account, record }
|
|
|
|
|
|
|
|
let!(:record) { create :personal_account }
|
|
|
|
|
2019-09-01 11:27:18 +00:00
|
|
|
for_account_types nil, :usual, :superuser do
|
2019-02-01 21:36:10 +00:00
|
|
|
it { is_expected.to permit_action :show }
|
|
|
|
|
|
|
|
it { is_expected.to forbid_action :index }
|
|
|
|
it { is_expected.to forbid_new_and_create_actions }
|
|
|
|
it { is_expected.to forbid_edit_and_update_actions }
|
|
|
|
it { is_expected.to forbid_action :destroy }
|
|
|
|
end
|
|
|
|
end
|