File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change 1
1
module Kracken
2
2
class Config
3
- attr_accessor :app_id , :app_secret
4
- attr_writer :provider_url , :user_class
3
+ attr_accessor :app_id , :app_secret , :user_class
4
+ attr_writer :provider_url
5
5
6
6
def initialize
7
7
@user_class = nil
@@ -12,7 +12,7 @@ def provider_url
12
12
end
13
13
14
14
def user_class
15
- @user_class || ::User
15
+ ::User
16
16
end
17
17
end
18
18
end
Original file line number Diff line number Diff line change @@ -125,22 +125,13 @@ def authenticate_or_request_with_http_token(realm = nil)
125
125
end
126
126
127
127
it "lazy loads the current user" do
128
- begin
129
- # Ensure we cannot lookup a user - doing so would raise an error
130
- org_user_class = Kracken . config . user_class
131
- user_class = double ( "AnyUserClass" )
132
- Kracken . config . user_class = user_class
133
-
134
- # Action under test
135
- a_controller . authenticate_user_with_token!
128
+ # Action under test
129
+ a_controller . authenticate_user_with_token!
136
130
137
- # Make sure we perform the lookup as expected now
138
- expect ( user_class ) . to receive ( :find ) . with ( :any_id ) . and_return ( :user )
131
+ # Make sure we perform the lookup as expected now
132
+ expect ( :: User ) . to receive ( :find ) . with ( :any_id ) . and_return ( :user )
139
133
140
- expect ( a_controller . current_user ) . to be :user
141
- ensure
142
- Kracken . config . user_class = org_user_class
143
- end
134
+ expect ( a_controller . current_user ) . to be :user
144
135
end
145
136
end
146
137
You can’t perform that action at this time.
0 commit comments