Skip to content

Conversation

@Tetramputechture
Copy link
Contributor

@Tetramputechture Tetramputechture commented Jun 11, 2018

When using assertions, we should prefer to use more specific assertion functions for more meaningful tests, error messages, and easier debugging.

For example, using only assert gives us Expected false to be truthy on failure, but using something like assert_includes will give us Expected {string} to include {substring}.

@proctoru-bot
Copy link

@Tetramputechture, please add a Type label.

assert_predicate @user, :valid? # on error: expected @user to be valid?
assert_includes response['message'], 'must be a valid email' # on error: expected response['message'] to include 'must be a valid email`
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants