Conversation
… tests for validations
Media RankerWhat We're Looking For
|
CheezItMan
reviewed
Oct 24, 2018
| # Act | ||
| result = user.valid? | ||
| # Assert | ||
| expect(result).must_equal false |
There was a problem hiding this comment.
You should then make the username 2 letters long and verify that the user is now valid.
|
|
||
| end | ||
|
|
||
| describe "custom methods" do |
| expect(result).must_equal false | ||
| end | ||
|
|
||
| it 'a publication year must be greater than 0' do |
| expect(result).must_equal false | ||
| end | ||
|
|
||
| it 'a publication year must be greater less than 2019' do |
There was a problem hiding this comment.
Just a note on the validation, hardcoding the valid years to be limited to 2019, means that in a year or two...
| expect(result).must_equal false | ||
| end | ||
|
|
||
| it 'a description may not be more than 250 characters' do |
There was a problem hiding this comment.
You should also test at 249 characters.
| end | ||
|
|
||
| it 'a description must be 5 or more characters' do | ||
| # Arrange |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?