Module: RSpecApi::Expectations::Response::Body::Collection

Defined in:
lib/rspec-api/expectations/body/collection.rb

Instance Method Summary collapse

Instance Method Details

#expect_a_collection(response, expectations = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rspec-api/expectations/body/collection.rb', line 8

def expect_a_collection(response, expectations = {})
  include RSpecApi::Matchers

  if should_check_collection(response, expectations)
    if expectations[:collection]
      it { expect(response).to be_a_collection }
    else
      it { expect(response).not_to be_a_collection }
    end
  end
end