summaryrefslogtreecommitdiff
path: root/spec/requests/user_security_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/user_security_spec.rb')
-rw-r--r--spec/requests/user_security_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/requests/user_security_spec.rb b/spec/requests/user_security_spec.rb
new file mode 100644
index 00000000000..3c923870e86
--- /dev/null
+++ b/spec/requests/user_security_spec.rb
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe "Users Security" do
+ describe "Project" do
+ before do
+ @u1 = Factory :user
+ end
+
+ describe "GET /login" do
+ it { new_user_session_path.should be_denied_for @u1 }
+ it { new_user_session_path.should be_denied_for :admin }
+ it { new_user_session_path.should be_denied_for :user }
+ it { new_user_session_path.should be_allowed_for :visitor }
+ end
+
+ describe "GET /keys" do
+ it { keys_path.should be_allowed_for @u1 }
+ it { keys_path.should be_allowed_for :admin }
+ it { keys_path.should be_allowed_for :user }
+ it { keys_path.should be_denied_for :visitor }
+ end
+
+ describe "GET /profile" do
+ it { profile_path.should be_allowed_for @u1 }
+ it { profile_path.should be_allowed_for :admin }
+ it { profile_path.should be_allowed_for :user }
+ it { profile_path.should be_denied_for :visitor }
+ end
+
+ describe "GET /profile/password" do
+ it { profile_password_path.should be_allowed_for @u1 }
+ it { profile_password_path.should be_allowed_for :admin }
+ it { profile_password_path.should be_allowed_for :user }
+ it { profile_password_path.should be_denied_for :visitor }
+ end
+ end
+end