2011-10-08 23:36:38 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Users Security" do
|
|
|
|
describe "Project" do
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2012-11-06 04:31:55 +01:00
|
|
|
@u1 = create(:user)
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
describe "GET /login" do
|
2011-10-17 12:39:03 +02:00
|
|
|
it { new_user_session_path.should_not be_404_for :visitor }
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
describe "GET /keys" do
|
2012-08-25 19:43:55 +02:00
|
|
|
subject { keys_path }
|
|
|
|
|
|
|
|
it { should be_allowed_for @u1 }
|
|
|
|
it { should be_allowed_for :admin }
|
|
|
|
it { should be_allowed_for :user }
|
|
|
|
it { should be_denied_for :visitor }
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
describe "GET /profile" do
|
2012-08-25 19:43:55 +02:00
|
|
|
subject { profile_path }
|
|
|
|
|
|
|
|
it { should be_allowed_for @u1 }
|
|
|
|
it { should be_allowed_for :admin }
|
|
|
|
it { should be_allowed_for :user }
|
|
|
|
it { should be_denied_for :visitor }
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
|
2012-09-14 18:13:25 +02:00
|
|
|
describe "GET /profile/account" do
|
2012-12-02 12:29:24 +01:00
|
|
|
subject { account_profile_path }
|
|
|
|
|
|
|
|
it { should be_allowed_for @u1 }
|
|
|
|
it { should be_allowed_for :admin }
|
|
|
|
it { should be_allowed_for :user }
|
|
|
|
it { should be_denied_for :visitor }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /profile/design" do
|
|
|
|
subject { design_profile_path }
|
2012-08-25 19:43:55 +02:00
|
|
|
|
|
|
|
it { should be_allowed_for @u1 }
|
|
|
|
it { should be_allowed_for :admin }
|
|
|
|
it { should be_allowed_for :user }
|
|
|
|
it { should be_denied_for :visitor }
|
2011-10-08 23:36:38 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|