Skip to content

Commit d7b4841

Browse files
Updates test to check for no session
1 parent 8f7e6d7 commit d7b4841

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/kracken/controllers/authenticatable_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ class ControllerDouble < BaseControllerDouble
137137
end
138138

139139
context "user cache key" do
140+
it "does nothing if the session does not exist" do
141+
allow(controller).to receive(:request).and_return(double(format: nil, fullpath: nil))
142+
allow(controller).to receive(:redirect_to)
143+
144+
controller.handle_user_cache_key!
145+
146+
expect(controller).to_not have_received(:redirect_to)
147+
end
148+
140149
it "ends session and redirects if stored key does not match session key" do
141150
controller.session[:user_cache_key] = "123"
142151
controller.session[:user_uid] = "123"

0 commit comments

Comments
 (0)