debian-mirror-gitlab/spec/features/security/profile_access_spec.rb

66 lines
1.8 KiB
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
require 'spec_helper'
2015-04-26 12:48:37 +05:30
describe "Profile access", feature: true do
before do
@u1 = create(:user)
end
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /login" do
it { expect(new_user_session_path).not_to be_404_for :visitor }
end
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /profile/keys" do
subject { profile_keys_path }
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
it { is_expected.to be_allowed_for @u1 }
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
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /profile" do
subject { profile_path }
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
it { is_expected.to be_allowed_for @u1 }
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
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /profile/account" do
subject { profile_account_path }
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
it { is_expected.to be_allowed_for @u1 }
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
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /profile/design" do
subject { design_profile_path }
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
it { is_expected.to be_allowed_for @u1 }
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
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /profile/history" do
subject { history_profile_path }
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
it { is_expected.to be_allowed_for @u1 }
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
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
describe "GET /profile/notifications" do
subject { profile_notifications_path }
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
it { is_expected.to be_allowed_for @u1 }
it { is_expected.to be_allowed_for :admin }
it { is_expected.to be_allowed_for :user }
it { is_expected.to be_denied_for :visitor }
2014-09-02 18:07:02 +05:30
end
end