We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I'm trying to use Clearance::BackDoor on my requests specs that use rswag gem.
Clearance::BackDoor
My sample test is:
require 'swagger_helper' RSpec.describe 'api/v1/animals', type: :request do let!(:customer) { create(:customer) } before do visit session_path(as: customer) end path '/api/v1/animals' do let!(:animals) { create_list(:animal, 2, customer: customer) } get('list animals') do security [cookies: []] produces 'application/json' response(200, 'successful') do after do |example| puts response.request.inspect example.metadata[:response][:content] = { 'application/json' => { example: JSON.parse(response.body, symbolize_names: true) } } end run_test! do expect(response.body).to match_json_schema('response') end end end end
I'm getting the error:
1.1) Failure/Error: visit session_path(as: customer) NoMethodError: undefined method `visit' for #<RSpec::ExampleGroups::ApiV1Animals::ApiV1Animals::Get::Successful:0x0000557b76384bd0>
My test.rb has:
# test.rb Rails.application.configure do ... config.middleware.use Clearance::BackDoor end
I tested on Clearance 2.5.0, 2.2.1 and 1.16.1
I can execute this in replacement of visit:
visit
before do backdoor = Clearance::BackDoor.new(ENV) puts backdoor.inspect end
And I got a result. So, the backdoor was injected into my code.
Could you help me, please? Am I missing something?
Thank you!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I'm trying to use
Clearance::BackDoor
on my requests specs that use rswag gem.My sample test is:
I'm getting the error:
My test.rb has:
I tested on Clearance 2.5.0, 2.2.1 and 1.16.1
I can execute this in replacement of
visit
:And I got a result. So, the backdoor was injected into my code.
Could you help me, please? Am I missing something?
Thank you!
The text was updated successfully, but these errors were encountered: