Files
openfoodnetwork/spec/requests/large_request_spec.rb
Matt-Yorkley 3615dcd355 Fix namespacing in cookies test
NameError: uninitialized constant ActionDispatch::Cookies::SignedCookieJar::MAX_COOKIE_SIZE
     # ./spec/requests/large_request_spec.rb:8
2020-02-22 11:06:51 +00:00

14 lines
563 B
Ruby

# Large requests can fail if Devise tries to store the URL in the session cookie.
#
# http://daniel.fone.net.nz/blog/2014/11/28/actiondispatch-cookies-cookieoverflow-via-devise-s-user_return_to/
require 'spec_helper'
RSpec.describe 'A very large request', type: :request do
it 'should not overflow cookies' do
get '/admin', foo: 'x' * ActionDispatch::Cookies::MAX_COOKIE_SIZE
expect(response.status).to eq(302) # HTTP status 302 - Found
## Use the newer syntax if rspec gets upgraded
# expect(response).to have_http_status(:redirect)
end
end