jsonapi-rb / jsonapi-rspec

RSpec matchers for JSON:API spec
https://rubygems.org/gems/jsonapi-rspec
MIT License
123 stars 24 forks source link

add have_all_attributes_in #12

Closed mkamensky closed 4 years ago

mkamensky commented 4 years ago

Added another matcher to check that all attributes are included in the given list

stas commented 4 years ago

@mkamensky could you please help us understand how is this different from the have_attributes matcher?

mkamensky commented 4 years ago

@mkamensky could you please help us understand how is this different from the have_attributes matcher?

As far as I understand, have_attributes checks that all given attributes exist. This one checks that there are no other attributes included (my use case authorization, I want to make sure that only the permitted attributes are returned).

stas commented 4 years ago

@mkamensky I don't think we should introduce a new matcher. Let's use the existing one and extend it's functionality using a parameter/chained call. If that's ok with you and you want to submit a PR, I'll be happy to take a look. Alternatively, I'll be looking into #4 and will review this one along with it.

stas commented 4 years ago

Superseded by #14