Created
March 31, 2017 16:23
-
-
Save zavan/f4d34dd86bf825db549a0ac28c7e10d5 to your computer and use it in GitHub Desktop.
Clarance auth strategy for derailed_benchmarks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See: https://github.com/thoughtbot/clearance/blob/3e9529a643cff20beb9bb49eacedb90dee49d465/lib/clearance/testing/controller_helpers.rb | |
class ClearanceAuth < DerailedBenchmarks::AuthHelper | |
def setup | |
require 'clearance/session' | |
@user = User.first # Change to fit your needs | |
end | |
def call(env) | |
env[:clearance] = Clearance::Session.new(env) | |
env[:clearance].sign_in(@user) | |
app.call(env) | |
end | |
end | |
DerailedBenchmarks.auth = ClearanceAuth.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment