File tree 2 files changed +30
-0
lines changed
spec/requests/authorization
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,5 @@ group :development, :test do
28
28
gem 'sqlite3' , '~> 1.3'
29
29
end
30
30
end
31
+ gem "cancan" if ENV [ "AUTHORIZATION_ADAPTER" ] == "cancan"
31
32
end
Original file line number Diff line number Diff line change
1
+ if ENV [ "AUTHORIZATION_ADAPTER" ] == "cancan"
2
+ require 'spec_helper'
3
+
4
+ class Ability
5
+ include CanCan ::Ability
6
+ def initialize ( user )
7
+ can :manage , :all
8
+ end
9
+ end
10
+
11
+ describe "RailsAdmin CanCan Authorization" do
12
+ before ( :each ) do
13
+ RailsAdmin ::Config . authorization_adapter = :cancan
14
+ end
15
+
16
+ describe "GET /admin" do
17
+ before ( :each ) do
18
+ get rails_admin_dashboard_path
19
+ end
20
+
21
+ it "should respond successfully" do
22
+ response . code . should == "200"
23
+ end
24
+
25
+ end
26
+
27
+ end
28
+
29
+ end
You can’t perform that action at this time.
0 commit comments