2019-05-23 14:07:59 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe "Profile access" do
|
2015-07-21 22:09:02 -04:00
|
|
|
include AccessMatchers
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
describe "GET /-/profile/keys" do
|
2015-03-08 23:52:22 -04:00
|
|
|
subject { profile_keys_path }
|
2012-08-25 13:43:55 -04:00
|
|
|
|
2015-03-08 23:52:22 -04:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
|
|
|
end
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
describe "GET /-/profile" do
|
2015-03-08 23:52:22 -04:00
|
|
|
subject { profile_path }
|
2012-12-02 06:29:24 -05:00
|
|
|
|
2015-03-08 23:52:22 -04:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
|
|
|
end
|
2012-12-02 06:29:24 -05:00
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
describe "GET /-/profile/account" do
|
2015-03-08 23:52:22 -04:00
|
|
|
subject { profile_account_path }
|
2012-08-25 13:43:55 -04:00
|
|
|
|
2015-03-08 23:52:22 -04:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
|
|
|
end
|
2013-09-25 07:05:03 -04:00
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
describe "GET /-/profile/preferences" do
|
2015-06-05 14:00:21 -04:00
|
|
|
subject { profile_preferences_path }
|
2013-09-25 07:05:03 -04:00
|
|
|
|
2015-03-08 23:52:22 -04:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
|
|
|
end
|
2013-09-25 07:05:03 -04:00
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
describe "GET /-/profile/audit_log" do
|
2015-07-03 07:54:50 -04:00
|
|
|
subject { audit_log_profile_path }
|
2013-09-25 07:05:03 -04:00
|
|
|
|
2015-03-08 23:52:22 -04:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
|
|
|
end
|
2013-09-25 07:05:03 -04:00
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
describe "GET /-/profile/notifications" do
|
2015-03-08 23:52:22 -04:00
|
|
|
subject { profile_notifications_path }
|
2013-09-25 07:05:03 -04:00
|
|
|
|
2015-03-08 23:52:22 -04:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|
|
|
|
end
|