Merge pull request #7371 from luisramos0/engine

[Rails 5.2] Fix specs in engines
This commit is contained in:
Andy Brett
2021-04-09 16:25:50 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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