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

Add and tweak barcode tests #4700

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sampart
Copy link
Contributor

@sampart sampart commented Oct 2, 2024

Part of #3554

Description

#3554 is about addressing TODO comments. There were several in spec/models/barcode_item_spec.rb about adding tests.

  • Some tests were covered by what already existed in the "filters" context; we deleted those empty describes (and their TODO comments) and added a comment pointing readers to that context
  • We added a new test for by_item_partner_key but since it's also used in filtering, we put it in that context too
  • We made the existing test for by_base_item_partner_key more robust by adding a test on the number of returned items
  • Also, the description of described "global" didn't match behaviour, so we updated that.

Paired with @mgriffin ❤️

Type of change

  • Test improvements

How Has This Been Tested?

CI

@@ -58,17 +58,29 @@
it "->barcodeable_id shows only barcodes for a specific barcodeable_id" do
global_barcode_item
create(:global_barcode_item, base_item: create(:base_item))
results = BarcodeItem.barcodeable_id(base_item.id)
items = BarcodeItem.barcodeable_id(base_item.id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This felt more descriptive, and matches what we used in our new/altered tests below.

@sampart sampart marked this pull request as ready for review October 2, 2024 13:42
@cielf cielf requested a review from dorner October 2, 2024 16:46
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.

1 participant