23 Sep '14, 5pm

Validating JSON Schemas with an RSpec Matcher

At thoughtbot we’ve been experimenting with using JSON Schema , a widely-used specification for describing the structure of JSON objects, to improve workflows for documenting and validating JSON APIs. Describing our JSON APIs using the JSON Schema standard allows us to automatically generate and update our HTTP clients using tools such as heroics for Ruby and Schematic for Go, saving loads of time for client developers who are depending on the API. It also allows us to improve test-driven development of our API. If you’ve worked on a test-driven JSON API written in Ruby before, you’ve probably encountered a request spec that looks like this: describe "Fetching the current user" do context "with valid auth token" do it "returns the current user" do user = create(:user) auth_header = { "Auth-Token" => user.auth_token } get v1_current_user_url, {}, auth_header current_user = ...

Full article: http://robots.thoughtbot.com/validating-json-schemas-with...

Tweets

Validating JSON Schemas with an RSpec Matcher

rubyflow.com 23 Sep '14, 7pm

Validating JSON Schemas with an RSpec Matcher Posted by croaky on September 23, 2014 — 0 comments Use RSpec and JSON Schem...

Write Modular RSpec: RSpec is the most popular test framework in Ruby/Rails environments. Two of its biggest b...

Write Modular RSpec: RSpec is the most popular ...

sitepoint.com 29 Sep '14, 2pm

require 'rubygems' require 'json' shared_context "Login" do |weatherisgood, email, password| it "succeeds for user: #{emai...

Datacoup: Ruby on Rails, MongoDB, MySQL, Rspec,...

eden7garden.com 25 Sep '14, 6am

We are 5 man scrappy startup from New York City called Datacoup. Of the 5 members, 2 are only full stack devs and the othe...