Unnecessary system tests for filters #338
themudassarhassan
started this conversation in
General
Replies: 1 comment 4 replies
-
I see your point! Feel free to open a PR that tests the filters in a better way. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey @joemasilotti
I was working on the test coverage of filtering developers by their bio or hero feature and noticed the system tests in
test/system/filters_test.rb
does not provide any value/confidence for writing tests because what these test cases are testing for is already covered in the integration tests intest/integration/developers_test.rb
.Let me explain why test cases for filters are not providing any value, these tests are asserting that when the user clicks on some filter that filter's value should be added in the query parameter of the
URL
on the other hand in integration tests ofdevelopers_test.rb
we are visiting theURL
with the required query parameters and then asserting on the returned results so if something with the query parameter of theURL
goes side ways the integration tests will fail (deprecating the need for having separate tests for filters)Also as the order of query parameters does not matter in the

URL
and filter test cases are comparing strings forURL
matching so if we don't keep the order the assertion will fail (false negative test). For example:Please let me know what do you think about it or if I make sense altogether :D
Beta Was this translation helpful? Give feedback.
All reactions