Closed keithmgould closed 9 years ago
Hey @keithmgould I am wondering have you looked into https://github.com/playround/rspec_api_blueprint and https://github.com/lonelyplanet/vigia ?
Hey @zdne thank you. The former looks like it is only able to generate blueprint docs, and the latter does not look like it integrates in well with with existing Rspec request specs. I would like to augment my request specs, which are already pretty far along, with blueprint validation.
something like:
expect(response.body).to be_valid_against("user")
and I'd write the custom matcher to check a blueprint directory for "user.md", or something...
I would like to augment my request specs, with blueprint validation
@keithmgould That seems like a good idea. However I am afraid there is no such a tool at the moment. Not sure what would be easier – extending the Vigia or writing a new RSpec extension from scratch (sorry I am not proficient in Ruby).
When it comes to processing API Blueprint in Ruby there are three options:
On Jun 9, 2015, at 3:48 AM, Z notifications@github.com wrote:
@keithmgould https://github.com/keithmgould That seems like a good idea. However I am afraid there is no such a tool at the moment. Not sure what would be easier – extending the Vigia or writing a new RSpec extension from scratch (sorry I am not proficient in Ruby).
If you have a working RSpec suite, you can also add in TestUnit examples; RSpec will manage and run them. This is a lot more convenient for API tests, as RSpec examples assume a lot about your class hierarchies (i.e., that they're Rails bits). Here's a good write-up: http://matthewlehner.net/rails-api-testing-guidelines/ http://matthewlehner.net/rails-api-testing-guidelines/
Jack Repenning Jack@netgate.net
Hey @jrep, thank you. Thats a great article. Not sure if I am missing something -- does this help with my question about tying in Blueprint?
On Jun 9, 2015, at 3:49 PM, Keith Gould notifications@github.com wrote:
Hey @jrep https://github.com/jrep, thank you. Thats a great article. Not sure if I am missing something -- does this help with my question about tying in Blueprint?
Kinda tangential, I guess. What I was thinking: "whatever you figure out about how to solve your real problem, it'll probably be easier this way."
Jack Repenning Jack@netgate.net
Hey Guys,
I'd like to look at specific response bodies, and validate them against blueprints. Very similar to whats going on here for json schema.
https://robots.thoughtbot.com/validating-json-schemas-with-an-rspec-matcher
In particular I'd like to:
0.create a blueprint markdown file 0.create a request spec 0.compare the results in the response body to the markdown file.
Any help would be greatly appreciated!
PS: If not possible, could I at least use a tool to generate json schema from the blueprints, so that I can use the solution I linked to above?