Permalink
Browse files

Use env[:clearance] instead of env[:session]

  • Loading branch information...
1 parent a49a345 commit 7589b607196c12f72d9ea8b2cee468e4fb5abbac @calebthompson calebthompson committed Feb 27, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/clearance/back_door.rb
  2. +4 −4 spec/clearance/back_door_spec.rb
View
2 lib/clearance/back_door.rb
@@ -35,7 +35,7 @@ def sign_in_through_the_back_door(env)
if user_id.present?
user = ::User.find(user_id)
- env[:session].sign_in(user)
+ env[:clearance].sign_in(user)
end
end
end
View
8 spec/clearance/back_door_spec.rb
@@ -10,7 +10,7 @@
result = back_door.call(env)
- env[:session].should have_received(:sign_in).with(user)
+ env[:clearance].should have_received(:sign_in).with(user)
result.should eq mock_app.call(env)
end
@@ -20,7 +20,7 @@
result = back_door.call(env)
- env[:session].should have_received(:sign_in).never
+ env[:clearance].should have_received(:sign_in).never
result.should eq mock_app.call(env)
end
@@ -29,8 +29,8 @@ def env_without_user_id
end
def env_for_user_id(user_id)
- session = stub('session', sign_in: true)
- Rack::MockRequest.env_for("/?as=#{user_id}").merge(session: session)
+ clearance = stub('clearance', sign_in: true)
+ Rack::MockRequest.env_for("/?as=#{user_id}").merge(clearance: clearance)
end
def mock_app

0 comments on commit 7589b60

Please sign in to comment.