Open Bartuz opened 9 years ago
@Bartuz The library is tested - so you don't need to test any of the features that you get from mongoid-enum, so I would just be testing your enums the same way you would test any attribute on your Mongoid documents.
Ok, but there are rspec matchers which I can use this way:
it { is_expected.to have_fields(:birthdate, :registered_at).of_type(DateTime) }
there is not anything likee this for this gem, right?
No, the library doesn't come with any RSpec matchers, but the fields are (at this point in time) just strings (or symbols - I can't quite remember precisely), so:
it { is expected.to have_fields(:foobar_enum).of_type(String)
Would be adequate here, IMHO.
How should I test enum setup in my app?