RSpec JSON Schema Matcher 1
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
expect(response.status).to eq 200
expect(response).to match_response_schema("user")
end
end
end
1 Validating JSON Schemas with an RSpec Matcher