Sha256: d27c9ac9a0082aa443f815a9920dcfb198a6ac5a51de99ef06f784fc585db14d

Contents?: true

Size: 335 Bytes

Versions: 139

Compression:

Stored size: 335 Bytes

Contents



RSpec::Matchers.define :have_attributes do |expected_attributes|
  match do |actual|
    # actual is a Hash object representing an object, like this:
    # { "name" => "Product #1" }
    actual_attributes = actual.keys.map(&:to_sym)
    expected_attributes.map(&:to_sym).all? { |attr| actual_attributes.include?(attr) }
  end
end

Version data entries

139 entries across 139 versions & 3 rubygems

Version Path
solidus_api-1.2.3 spec/support/have_attributes_matcher.rb
solidus_api-1.1.4 spec/support/have_attributes_matcher.rb
solidus_api-1.0.7 spec/support/have_attributes_matcher.rb
spree_api-3.3.0.rc1 spec/support/have_attributes_matcher.rb
spree_api-3.1.5 spec/support/have_attributes_matcher.rb
spree_api-3.2.1 spec/support/have_attributes_matcher.rb
spree_api-3.2.0 spec/support/have_attributes_matcher.rb
spree_api-3.1.4 spec/support/have_attributes_matcher.rb
spree_api-3.2.0.rc3 spec/support/have_attributes_matcher.rb
spree_api-3.2.0.rc2 spec/support/have_attributes_matcher.rb
spree_api-3.2.0.rc1 spec/support/have_attributes_matcher.rb
spree_api-3.1.3 spec/support/have_attributes_matcher.rb
spree_api-3.1.2 spec/support/have_attributes_matcher.rb
spree_api-3.0.10 spec/support/have_attributes_matcher.rb
spree_api-3.1.1 spec/support/have_attributes_matcher.rb
spree_api-3.1.0 spec/support/have_attributes_matcher.rb
spree_api-3.1.0.rc4 spec/support/have_attributes_matcher.rb
spree_api-3.0.9 spec/support/have_attributes_matcher.rb
spree_api-3.1.0.rc3 spec/support/have_attributes_matcher.rb
spree_api-3.1.0.rc2 spec/support/have_attributes_matcher.rb