small medium large xlarge

10 Oct 2017, 16:38
Nitish Madhukar Vantha (1 post)

I am having difficulty def match_the_shape_of_a_user_record; end method. Could someone advise me on this?

10 Oct 2017, 16:59
Myron Marston (15 posts)

That method is meant to return a matcher that matches user records by specifying the “shape” of a user record. In this example, a user record is a hash with certain keys (email_address, date_of_birth, and active). The values for these keys are random each time (which is why you can’t simply use expect(user).to eq(expected_hash)) but there are some methods above (be_a_boolean, be_a_date_before_2000, be_an_email_address) that you should have filled so that they match the user values even though they are random.

So, you’re task is to change the hash passed to match in the match_the_shape_of_a_user_record method so that it describes the keys and values of a user record.

Does that make sense? If you’re still confused, let us know which part specifically is giving you trouble.

You must be logged in to comment