Module: RSpecApi::Matchers

Includes:
Attributes, Collection, ContentType, Filter, Json, Jsonp, PageLinks, Response, Sort, Status
Defined in:
lib/rspec-api/matchers.rb,
lib/rspec-api/matchers/version.rb,
lib/rspec-api/matchers/json/matcher.rb,
lib/rspec-api/matchers/sort/matcher.rb,
lib/rspec-api/matchers/jsonp/matcher.rb,
lib/rspec-api/matchers/filter/matcher.rb,
lib/rspec-api/matchers/sort/be_sorted.rb,
lib/rspec-api/matchers/status/matcher.rb,
lib/rspec-api/matchers/headers/matcher.rb,
lib/rspec-api/matchers/response/matcher.rb,
lib/rspec-api/matchers/attributes/matcher.rb,
lib/rspec-api/matchers/collection/matcher.rb,
lib/rspec-api/matchers/filter/be_filtered.rb,
lib/rspec-api/matchers/json/be_valid_json.rb,
lib/rspec-api/matchers/page_links/matcher.rb,
lib/rspec-api/matchers/status/have_status.rb,
lib/rspec-api/matchers/content_type/matcher.rb,
lib/rspec-api/matchers/headers/have_headers.rb,
lib/rspec-api/matchers/attributes/have_attributes.rb,
lib/rspec-api/matchers/collection/be_a_collection.rb,
lib/rspec-api/matchers/page_links/have_page_links.rb,
lib/rspec-api/matchers/jsonp/be_wrapped_in_callback.rb,
lib/rspec-api/matchers/response/be_a_valid_response.rb,
lib/rspec-api/matchers/content_type/have_content_type.rb

Overview

Provides RSpec Matchers for RESTful web APIs.

To have these matchers available inside of an RSpec ‘describe` block, tag that block with the `:rspec_api` metadata, or explicitly include the RSpecApi::Matchers module inside the example group

Examples:

Tag a ‘describe` block as `:rspec_api`:

describe "Artists", rspec_api: true do
   ... # here you can write `expect(response).to have_status :ok`, etc.
end

Explicitly include the RSpecApi::Matchers module

describe "Artists" do
   include RSpecApi::Matchers
   ... # here you can write `expect(response).to have_status :ok`, etc.
end

Defined Under Namespace

Modules: Attributes, Collection, ContentType, Filter, Headers, Json, Jsonp, PageLinks, Response, Sort, Status

Constant Summary collapse

VERSION =
'0.7.1'

Method Summary

Methods included from Status

#have_status

Methods included from Sort

#be_sorted

Methods included from Response

#be_a_valid_response

Methods included from PageLinks

#have_page_links

Methods included from Jsonp

#be_wrapped_in_callback

Methods included from Json

#be_valid_json

Methods included from Filter

#be_filtered

Methods included from ContentType

#have_content_type

Methods included from Collection

#be_a_collection

Methods included from Attributes

#have_attributes