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

is the library rails specific? #5

Closed
AlexeyMatskevich opened this issue Jul 10, 2020 · 4 comments
Closed

is the library rails specific? #5

AlexeyMatskevich opened this issue Jul 10, 2020 · 4 comments

Comments

@AlexeyMatskevich
Copy link
Contributor

I try to setup simple application written on Roda. For request test I use rspec + rack-test
My simple spec

describe "School", type: :request do
  ...
  it "return 200" do
    post "/school", {id: 1}.to_json, "CONTENT_TYPE" => "application/json"
    expect(last_response.status).to eq(200)
  end
end

When I run the tests, they pass successfully but nothing is generated and does not happen.

@AlexeyMatskevich
Copy link
Contributor Author

After require "rspec/openapi" in spec get errors:

     Failure/Error:
       def request(uri, env = {}, &block)
         uri = parse_uri(uri, env)
         env = env_for(uri, env)
         process_request(uri, env, &block)
       end
     
     ArgumentError:
       wrong number of arguments (given 0, expected 1..2)
     Shared Example Group: "user success login" called from ./spec/idp_spec.rb:20
     # /usr/local/bundle/gems/rack-test-1.1.0/lib/rack/test.rb:116:in `request'
     # /usr/local/bundle/gems/rspec-openapi-0.2.2/lib/rspec/openapi/hooks.rb:11:in `block in <top (required)>'

@k0kubun
Copy link
Collaborator

k0kubun commented Jul 10, 2020

It's currently so https://github.com/k0kubun/rspec-openapi#current-limitations, but I can take a look at supporting Roda + rack-test.

@k0kubun
Copy link
Collaborator

k0kubun commented Jul 10, 2020

I added an initial support of rack-test and non-Rails apps like Roda. Please try v0.3.0.

Though path and summary here are probably not that great compared to ones generated for Rails. I'd appreciate your input or patch for these two lines as a Roda user.

@AlexeyMatskevich
Copy link
Contributor Author

It worked

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

2 participants