Remove redundant Profile access test cases
The user being created was no different than what `be_allowed_for` was doing behind the scenes so we were essentially testing all user-level accesses twice.
This commit is contained in:
parent
421b06508d
commit
ff8811c40b
|
@ -3,13 +3,9 @@ require 'spec_helper'
|
||||||
describe "Profile access", feature: true do
|
describe "Profile access", feature: true do
|
||||||
include AccessMatchers
|
include AccessMatchers
|
||||||
|
|
||||||
before do
|
|
||||||
@u1 = create(:user)
|
|
||||||
end
|
|
||||||
describe "GET /profile/keys" do
|
describe "GET /profile/keys" do
|
||||||
subject { profile_keys_path }
|
subject { profile_keys_path }
|
||||||
|
|
||||||
it { is_expected.to be_allowed_for @u1 }
|
|
||||||
it { is_expected.to be_allowed_for :admin }
|
it { is_expected.to be_allowed_for :admin }
|
||||||
it { is_expected.to be_allowed_for :user }
|
it { is_expected.to be_allowed_for :user }
|
||||||
it { is_expected.to be_denied_for :visitor }
|
it { is_expected.to be_denied_for :visitor }
|
||||||
|
@ -18,7 +14,6 @@ describe "Profile access", feature: true do
|
||||||
describe "GET /profile" do
|
describe "GET /profile" do
|
||||||
subject { profile_path }
|
subject { profile_path }
|
||||||
|
|
||||||
it { is_expected.to be_allowed_for @u1 }
|
|
||||||
it { is_expected.to be_allowed_for :admin }
|
it { is_expected.to be_allowed_for :admin }
|
||||||
it { is_expected.to be_allowed_for :user }
|
it { is_expected.to be_allowed_for :user }
|
||||||
it { is_expected.to be_denied_for :visitor }
|
it { is_expected.to be_denied_for :visitor }
|
||||||
|
@ -27,7 +22,6 @@ describe "Profile access", feature: true do
|
||||||
describe "GET /profile/account" do
|
describe "GET /profile/account" do
|
||||||
subject { profile_account_path }
|
subject { profile_account_path }
|
||||||
|
|
||||||
it { is_expected.to be_allowed_for @u1 }
|
|
||||||
it { is_expected.to be_allowed_for :admin }
|
it { is_expected.to be_allowed_for :admin }
|
||||||
it { is_expected.to be_allowed_for :user }
|
it { is_expected.to be_allowed_for :user }
|
||||||
it { is_expected.to be_denied_for :visitor }
|
it { is_expected.to be_denied_for :visitor }
|
||||||
|
@ -36,7 +30,6 @@ describe "Profile access", feature: true do
|
||||||
describe "GET /profile/preferences" do
|
describe "GET /profile/preferences" do
|
||||||
subject { profile_preferences_path }
|
subject { profile_preferences_path }
|
||||||
|
|
||||||
it { is_expected.to be_allowed_for @u1 }
|
|
||||||
it { is_expected.to be_allowed_for :admin }
|
it { is_expected.to be_allowed_for :admin }
|
||||||
it { is_expected.to be_allowed_for :user }
|
it { is_expected.to be_allowed_for :user }
|
||||||
it { is_expected.to be_denied_for :visitor }
|
it { is_expected.to be_denied_for :visitor }
|
||||||
|
@ -45,7 +38,6 @@ describe "Profile access", feature: true do
|
||||||
describe "GET /profile/audit_log" do
|
describe "GET /profile/audit_log" do
|
||||||
subject { audit_log_profile_path }
|
subject { audit_log_profile_path }
|
||||||
|
|
||||||
it { is_expected.to be_allowed_for @u1 }
|
|
||||||
it { is_expected.to be_allowed_for :admin }
|
it { is_expected.to be_allowed_for :admin }
|
||||||
it { is_expected.to be_allowed_for :user }
|
it { is_expected.to be_allowed_for :user }
|
||||||
it { is_expected.to be_denied_for :visitor }
|
it { is_expected.to be_denied_for :visitor }
|
||||||
|
@ -54,7 +46,6 @@ describe "Profile access", feature: true do
|
||||||
describe "GET /profile/notifications" do
|
describe "GET /profile/notifications" do
|
||||||
subject { profile_notifications_path }
|
subject { profile_notifications_path }
|
||||||
|
|
||||||
it { is_expected.to be_allowed_for @u1 }
|
|
||||||
it { is_expected.to be_allowed_for :admin }
|
it { is_expected.to be_allowed_for :admin }
|
||||||
it { is_expected.to be_allowed_for :user }
|
it { is_expected.to be_allowed_for :user }
|
||||||
it { is_expected.to be_denied_for :visitor }
|
it { is_expected.to be_denied_for :visitor }
|
||||||
|
|
Loading…
Reference in New Issue