Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrectly passing shared examples #3160

Merged
merged 4 commits into from
Feb 3, 2023
Merged

Fix incorrectly passing shared examples #3160

merged 4 commits into from
Feb 3, 2023

Conversation

Gerg
Copy link
Member

@Gerg Gerg commented Jan 25, 2023

A short explanation of the proposed change:

  • Detect if list/show/delete endpoint permissions shared example gets unexpected keys in the codes & responses hash

An explanation of the use cases your change solves

  • Now, tests using this shared example will fail if they get an unexpected key in the hash
  • It was easy to accidentally confuse "response_object" with "response_objects", which resulted in incorrectly passing tests that did not check the response body
  • Fix multiple tests that were incorrectly passing and were detected by this guard

Links to any other associated PRs

I noticed this issue while working on #3157

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

- Detect if list endpoint permissions shared example gets unexpected
  keys in the codes & responses hash
- Now, tests using this shared example will fail if they get an
  unexpected key in the hash
- It was easy to accidentally confuse "response_object" with
  "response_objects", which resulted in incorrectly passing tests that
  did not check the response body
- Fix multiple tests that were incorrectly passing and were detected by
  this guard
@Gerg Gerg changed the title Fix incorrectly passing list permissions shared example Fix incorrectly passing shared examples Jan 25, 2023
Gerg added 2 commits January 25, 2023 13:55
- Continuation of fix to the same issue for the list endpoint shared
  example
- Continuation of fix to the same issue for other shared examples
- Since there were several places where "errors" were provided in tests,
  add support for that key, based on other shared example
  implementations
@Gerg Gerg marked this pull request as ready for review January 26, 2023 04:32
Copy link
Member

@moleske moleske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been quite guilty of not always noticing the difference between response_object and response_objects. Thanks for fixing!

@moleske moleske merged commit 1f94310 into main Feb 3, 2023
@moleske moleske deleted the fix_shared_examples branch February 3, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants