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
update category unit model tests #546
update category unit model tests #546
Conversation
Do you not want to test the attributes of the |
@joshsmith just following the ember model testing guide, my understanding is that there is value in testing functions, computer properties and relationship declarations. I'm not sure how much value there is in testing plain attributes... Unless there is validations on them |
Same as #547 (comment) It would make sense to add a test that ensures all attributes are accounted for. |
I've updated this to test attribute existence. Reference this for method reasoning. |
Going to update this with relationship helpers from #547 once they get merged. |
12abd3a
to
bbf22ac
Compare
|
||
assert.ok(attributes.includes('description'), 'should have description attribute'); | ||
assert.ok(attributes.includes('name'), 'should have name attribute'); | ||
assert.ok(attributes.includes('slug'), 'should have slug attribute'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should refactor these into an assert.hasAttribute(attributes, 'attribute'
) which itself just runs assert.ok()
with the description we use there.
Let's make an issue to circle back there. Will DRY these up slightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good but let's open that issue.
bbf22ac
to
4e26f76
Compare
4e26f76
to
0b34021
Compare
What's in this PR?
Update
category
unit model testsReferences