Sha256: 5b474069107686d77d03ecc981963acc9a23302386a661904806d7a2dc34a072

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

require "spec_helper"

describe "Backdoor Middleware" do
  it "allows signing in using query parameter" do
    user = create(:user)

    get root_path(as: user.to_param)

    expect(cookies["remember_token"]).to eq user.remember_token
  end

  it "removes the `as` param but leaves other parameters unchanged" do
    user = create(:user)

    get root_path(as: user.to_param, foo: 'bar')

    expect(response.body).to include('{"foo":"bar","controller":"application","action":"show"}')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clearance-2.9.2 spec/requests/backdoor_spec.rb