You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run with everything but the last line, it succeeds. But with the last line, this happens:
1) FoosController should create group ownership
Failure/Error: expect(response).to redirect_to(root_path)
RuntimeError:
You must pass a block to Wrong's assert and deny methods
# /Users/john/src/wrong/lib/wrong/assert.rb:31:in `rescue in assert'
# /Users/john/src/wrong/lib/wrong/assert.rb:27:in `assert'
# ./spec/controllers/foos_controller_spec.rb:9:in `block (2 levels) in <top (required)>'
It's as if alias_assert :expect is being invoked, but just for that one spec.
I've experimented with different combinations and orderings and determined that the problem only happens when redirect_to is present.
Any ideas?
The text was updated successfully, but these errors were encountered:
I saw the same here. My assumption was that expect ... redirect_to is actually using assert deep down under the hood, since I get the same exact error when I try to call any of the "old guard" assert matchers like assert_redirected_to after including Wrong.
I interpret this to mean that once you install Wrong, you must use its DSL exclusively; it may break any of the old assertion styles. If that's necessary for it to do the magic it does, then that's fine, but I wonder if that warning could be made clearer in the readme? Or even better, perhaps there's an option I don't know about to name the assert method something different, so it doesn't clobber everything that depends on the old assert?
EDIT: It just occurred to me that adding the TestUnit and/or MiniTest adapters might help here, though I don't have the time to test this at the moment.
I have this spec:
Run with everything but the last line, it succeeds. But with the last line, this happens:
It's as if
alias_assert :expect
is being invoked, but just for that one spec.I've experimented with different combinations and orderings and determined that the problem only happens when
redirect_to
is present.Any ideas?
The text was updated successfully, but these errors were encountered: