We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd8fee2 commit 1f73297Copy full SHA for 1f73297
1 file changed
spec/controllers/user_controller_spec.rb
@@ -0,0 +1,23 @@
1
+require 'spec_helper'
2
+
3
+describe UsersController do
4
+ let(:bob){Fabricate(:user)}
5
+ let(:mozart){Fabricate(:user)}
6
7
+ describe('#index') do
8
+ context "When user is no moderator" do
9
+ it "try to get index" do
10
+ get :index
11
+ response.should redirect_to(root_path)
12
+ end
13
14
15
+ context "When user is moderator" do
16
+ before { sign_in Fabricate(:user, moderator: true) }
17
+ it "gets index with authorization" do
18
19
+ response.should be_success
20
21
22
23
+end
0 commit comments