mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-07 03:01:33 +00:00
Merge pull request #7371 from luisramos0/engine
[Rails 5.2] Fix specs in engines
This commit is contained in:
@@ -7,7 +7,7 @@ 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
|
||||
get '/admin', params: { 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)
|
||||
|
||||
@@ -6,7 +6,7 @@ describe EmbeddedPageService do
|
||||
let(:enterprise_slug) { 'test-enterprise' }
|
||||
let(:params) { { controller: 'enterprises', action: 'shop', id: enterprise_slug, embedded_shopfront: true } }
|
||||
let(:session) { {} }
|
||||
let(:request) { ActionController::TestRequest.new({'HTTP_HOST' => 'ofn-instance.com', 'HTTP_REFERER' => 'https://embedding-enterprise.com'}, nil) }
|
||||
let(:request) { ActionController::TestRequest.new({'HTTP_HOST' => 'ofn-instance.com', 'HTTP_REFERER' => 'https://embedding-enterprise.com'}, nil, nil) }
|
||||
let(:response) { ActionDispatch::TestResponse.new(200, 'X-Frame-Options' => 'DENY', 'Content-Security-Policy' => "frame-ancestors 'none'") }
|
||||
let(:service) { EmbeddedPageService.new(params, session, request, response) }
|
||||
|
||||
@@ -63,7 +63,7 @@ describe EmbeddedPageService do
|
||||
end
|
||||
|
||||
context "when the request's referer is malformed" do
|
||||
let(:request) { ActionController::TestRequest.new({'HTTP_HOST' => 'ofn-instance.com', 'HTTP_REFERER' => 'hello'}, nil) }
|
||||
let(:request) { ActionController::TestRequest.new({'HTTP_HOST' => 'ofn-instance.com', 'HTTP_REFERER' => 'hello'}, nil, nil) }
|
||||
before do
|
||||
service.embed!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user