Sha256: c5c81e1c8f7e73d31493a2adf3edff0c382a648048672370b13f1d7bfaf71e96

Contents?: true

Size: 330 Bytes

Versions: 22

Compression:

Stored size: 330 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

22 entries across 13 versions & 2 rubygems

Version Path
solidus_legacy_return_authorizations-1.0.2 spec/support/have_attributes_matcher.rb
solidus_legacy_return_authorizations-1.0.1 spec/support/have_attributes_matcher.rb
solidus_legacy_return_authorizations-1.0.0 spec/support/have_attributes_matcher.rb
gaku-0.2.4 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.4 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.3 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.3 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.2 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.2 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.1 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.1 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.0 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.2.0 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.1.1 archive/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.1.1 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.1.1 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.1.0 frontend/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.1.0 archive/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.1.0 admin/spec/support/controllers/matchers/have_attributes_matcher.rb
gaku-0.0.3 core/spec/support/have_attributes_matcher.rb