-
Notifications
You must be signed in to change notification settings - Fork 111
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
adds error messages for syntax errors #3486
Conversation
announcements = Announcements.all(f.path) | ||
announcement = announcements.first | ||
assert_equal :warning, announcement.type | ||
assert_send([announcement.instance_variable_get(:@error).to_str, :include?, "syntax error"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - I now see this is where you were using it!
If you're going to write a test for this, then maybe you should do something like this
Rails.logger.stubs(:warn).with("Syntax error in announcement ...").returns(0)
that stubs the warning log line with the specific message and the test will fail if Rails.logger.warn
is either called with different arguments (a different string) OR is never called at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this up! Sorry to hear you leave, good luck with everything!
Fixes #2700