module RSpecApi::Expectations::Response::Body::Attributes
Public Instance Methods
expect_attributes(response, expectations = {})
click to toggle source
# File lib/rspec-api/expectations/body/attributes.rb, line 8 def expect_attributes(response, expectations = {}) include RSpecApi::Matchers if should_check_attributes(response, expectations) it { expect(response).to have_attributes expectations[:attributes] } end end
Private Instance Methods
should_check_attributes(response, expectations)
click to toggle source
# File lib/rspec-api/expectations/body/attributes.rb, line 18 def should_check_attributes(response, expectations) expectations.key?(:attributes) && success?(response) && has_entity_body?(response) end