Skip to content

Commit

Permalink
Update to double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
derekprior committed Apr 15, 2016
1 parent 663b039 commit 881d734
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/clearance/back_door.rb
Expand Up @@ -44,8 +44,8 @@ def call(env)

# @api private
def sign_in_through_the_back_door(env)
params = Rack::Utils.parse_query(env['QUERY_STRING'])
user_param = params['as']
params = Rack::Utils.parse_query(env["QUERY_STRING"])
user_param = params["as"]

if user_param.present?
user = find_user(user_param)
Expand Down
14 changes: 7 additions & 7 deletions spec/clearance/back_door_spec.rb
@@ -1,8 +1,8 @@
require 'spec_helper'
require "spec_helper"

describe Clearance::BackDoor do
it 'signs in as a given user' do
user_id = '123'
it "signs in as a given user" do
user_id = "123"
user = double("user")
allow(User).to receive(:find).with(user_id).and_return(user)
env = env_for_user_id(user_id)
Expand All @@ -14,7 +14,7 @@
expect(result).to eq mock_app.call(env)
end

it 'delegates directly without a user' do
it "delegates directly without a user" do
env = env_without_user_id
back_door = Clearance::BackDoor.new(mock_app)

Expand All @@ -24,7 +24,7 @@
expect(result).to eq mock_app.call(env)
end

it 'can set the user via a block' do
it "can set the user via a block" do
env = env_for_username("foo")
user = double("user")
allow(User).to receive(:find_by).with(username: "foo").and_return(user)
Expand All @@ -39,7 +39,7 @@
end

def env_without_user_id
env_for_user_id('')
env_for_user_id("")
end

def env_for_user_id(user_id)
Expand All @@ -53,6 +53,6 @@ def env_for_username(username)
end

def mock_app
lambda { |env| [200, {}, ['okay']] }
lambda { |env| [200, {}, ["okay"]] }
end
end

0 comments on commit 881d734

Please sign in to comment.