-
Notifications
You must be signed in to change notification settings - Fork 59
Fix #26 by running assertion when we aren't testing for a body. #27
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
Conversation
Only the rubinius version failed. Travis says the gems might be corrupted. Do you know of a fix, Rafael? |
I didn't get the always passing assertion. Could you explain better? |
I couldn't find an assertion to run in this case except one that will always pass like Kasper
|
I see. I think we should run them. About rbx, let remove it from our suite from now. We need to change code on Rails right? |
Okay, I'll add an Yes, we need to revert this: rails/rails#17107 |
@rafaelfranca I've changed it a bit now. No longer is Note I'm calling return after running the assert_select 'body', 0 do
# block won't be run
end Is that okay? I can't think of a situation where people would nest a call to a document that had no body. |
We're creating Nokogiri documents from HTML fragments, which means Nokogiri automatically adds a body element which is unexpected.
I don't think this block case is valid. If you are using 0 as count you don't want to see the element in the response so it doesn't make sense to assert something inside it. |
Fix #26 by running assertion when we aren't testing for a body.
Applied rails/rails@1b9e85d |
Fixes #26.
I was wondering if we should run an always passing assertion though.
Imagine a user writing
assert_select 'body', 0
and then running the tests to find the assertion count doesn't go up.What do you think, @rafaelfranca and @chancancode?