Skip to content
New issue

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

Uninitialized constant Apivore #109

Open
mukkoo opened this issue Jul 20, 2017 · 2 comments
Open

Uninitialized constant Apivore #109

mukkoo opened this issue Jul 20, 2017 · 2 comments

Comments

@mukkoo
Copy link

mukkoo commented Jul 20, 2017

I've followed the guide and this is the result.
Running specs with rake spec:requests it works correctly.

Running specs with rspec spec/requests the result is:

Failure/Error: subject { Apivore::SwaggerChecker.instance_for('/swagger.json') }

     NameError:
       uninitialized constant Apivore

I've tried to require apivore inside my _spec and the error was:

 undefined method `application' for Rails:Module

I've followed the instructions here #75 adding, also, require 'rails' and the error was:

RuntimeError:
       Unable to perform GET request for swagger json: /swagger.json - undefined method `call' for nil:NilClass.

I need to require something more?

@tejasbubane
Copy link

tejasbubane commented Jul 27, 2017

Have you added type: :apivore to your top describe block? That was producing the uninitialized constant error for me.

Also you should add require "apivore" to either spec_helper.rb or rails_helper.rb (based on what you are requiring in the spec file).

@philsturgeon
Copy link

Had this same issue using Rails.

Using require "rails_helper" solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants