Module: RSpecApi::Resource

Includes:
Accepts, Actions, HasAttribute, Options
Defined in:
lib/rspec-api/resource.rb,
lib/rspec-api/resource/accepts.rb,
lib/rspec-api/resource/actions.rb,
lib/rspec-api/resource/options.rb,
lib/rspec-api/resource/has_attribute.rb

Overview

Provides actions and expectations method to RSpec Example groups, useful to describe the endpoints and expectations of a web API resource.

To have these matchers available inside of an RSpec describe block, include that block inside a block with the :rspec_api metadata, or explicitly include the RSpecApi::Resource module.

Examples:

Tag a describe block as :rspec_api:

describe "Artists", rspec_api: true do
  ... # here you can write `get`, `has_attribute`, `host`, etc.
end

Explicitly include the RSpecApi::Resource module

describe "Artists" do
  include RSpecApi::Resource
  ... # here you can write `get`, `has_attribute`, `host`, etc.
end

Defined Under Namespace

Modules: Accepts, Actions, HasAttribute, Options

Method Summary

Methods included from Accepts

#accepts

Methods included from HasAttribute

#has_attribute

Methods included from Options

#adapter, #authorize_with, #host, #throttle