weird error with should_be_restful and an empty template variable
Reported by Luke Francl | December 7th, 2007 @ 02:17 PM
I ran across a weird error while using should_be_restful with one of my controllers.
In the update test, I was getting a weird error like this:
test: on PUT to :update with {} should redirect to "account_children_path". (ChildrenControllerTest):
ArgumentError: interning empty string
method to_sym in controller_tests.rb at line 438
method instantiate_variables_from_assigns in controller_tests.rb at line 438
method each in controller_tests.rb at line 435
method instantiate_variables_from_assigns in controller_tests.rb at line 435
method __bind_1197054899_599172 in controller_tests.rb at line 386
method call in context.rb at line 98
method test: on PUT to :update with {} should redirect to "account_children_path". in context.rb at line 98
method run in default.rb at line 7
So I printed out the list of variables that instantiate_variables_from_assigns was working with and I got this:
["", "parent_name", "current_object", "child", "current_user", "view_paths", "parent_object", "save_succeeded"]
I have no idea how the empty string got in there, so I'm not sure if this is a problem with my code or if shoulda should skip the empty string. When I skip it (using: next if name.blank?) the test passes. And the code works fine if I test it manually.
Anyone else seen this problem?
Comments and changes to this ticket
-
Tammer Saleh January 21st, 2008 @ 09:19 AM
- → State changed from new to open
Hi Luke,
Are you still seeing this issue? If so, what version of rails are you using? If not, then I'd like to close this issue.
-

Luke Francl January 23rd, 2008 @ 08:04 PM
Go ahead and close it, I can't replicate it now.
I think it may have been happening because I was posting to the update action with "{}" ... which is not very realistic.
-
Tammer Saleh January 24th, 2008 @ 08:35 AM
- → State changed from open to resolved
OK, closing the ticket. Let me know if it creeps up again.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
