このコミットが含まれているのは:
@@ -1,4 +1,16 @@
|
||||
module AuthHelper
|
||||
def cookie_headers(user)
|
||||
env = Rails.application.env_config.merge(Rack::MockRequest.env_for('/'))
|
||||
endpoint = lambda do |request_env|
|
||||
ActionDispatch::Request.new(request_env).session[:inheritance_code] = user.inheritance_code
|
||||
[200, {}, []]
|
||||
end
|
||||
store = ActionDispatch::Session::CookieStore.new(
|
||||
endpoint, Rails.application.config.session_options)
|
||||
headers = ActionDispatch::Cookies.new(store).call(env)[1]
|
||||
{ 'Cookie' => Array(headers['set-cookie']).map { _1.split(';').first }.join('; ') }
|
||||
end
|
||||
|
||||
def sign_in_as(user)
|
||||
allow_any_instance_of(ApplicationController)
|
||||
.to receive(:current_user).and_return(user)
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする