See what I did in commit ad1de0d69ad9d9b0be457f5aeaeea3ca9c4ebe9e and do it for…
- User
See what I did in commit ad1de0d69ad9d9b0be457f5aeaeea3ca9c4ebe9e and do it for request_spec.rb
Assistant
Let me look at that commit to understand the changes, then read
request_spec.rb.Assistant
Let me also check the
to_jsonimplementation to know the exact output format.Assistant
Now I have everything I need. The pattern from the commit:
- Verbose
it '...' do; expect(x).to eq(y); end→specify { ... } - Multiple hash-field assertions → single
eqon the whole hash/string - Remove
eq({ ... })braces - JSON tests: drop
be_a(String)+ parse + field checks → direct string assertion - Remove redundant
not_to have_keywheneqalready covers it
- Verbose
Assistant
Let me verify the specs pass.
Assistant
All 13 pass. Fixing the 3 line-length RuboCop warnings.
Assistant
Good feedback —
specifyshould only be forbe_*matchers; everything else needs anitwith a description. Let me rewrite the whole file properly.Assistant
The diagnostic warning is Steep complaining about
method: 42(intentionally wrong type for the error test) — expected. Let me verify all tests still pass.Assistant
13/13 passing. Need to add the trailing newline.
Assistant
Now let me save your feedback about
specifyto memory.Assistant
All 13 examples pass. The changes applied from the commit pattern:
- Collapsed 4-attribute
#initializeassertions into a singleto_hequality check - Replaced
eq({ ... })witheq(...)(no braces) - Removed redundant
not_to have_keywhere the fulleqalready implies absence - Replaced multi-step JSON parse + field checks with direct string assertions
- Used
specifyonly forbe_nil(the onebe_*matcher); everything else keptitwith a description
- Collapsed 4-attribute