westfieldlabs / apivore

Tests your rails API against its Swagger description of end-points, models, and query parameters.
Apache License 2.0
213 stars 66 forks source link

[Feature, CNTR-190] Add ability to use a query parameter string #25

Closed gwshaw closed 9 years ago

gwshaw commented 9 years ago

Needed in movie service...but specs fail :(

hornc commented 9 years ago

LGTM in theory, apart from the failure:

Failures:

  1) Example API path /services.json method get response 200 responds with the specified models
     Failure/Error: path + (data['_query_string'] ? "?#{data['_query_string']}" : '')
     NoMethodError:
       undefined method `[]' for #<RSpec::Mocks::MessageExpectation:0x00000103626ea8>
     # ./lib/apivore/rspec_builder.rb:35:in `apivore_build_path'
     # ./lib/apivore/rspec_builder.rb:77:in `block (3 levels) in validate'
hornc commented 9 years ago

@gwshaw, I've rebased your code after my change to fix the setups to always be a Hash. I'll let you review to make sure everything looks good: https://github.com/westfieldlabs/apivore/pull/30

It seems the check for data being nil is not needed like I thought? Tests pass now anyway!