[haml] functional test raises ActionView::TemplateError: undefined method 'check_encoding' for <Haml::Engine>

15 views
Skip to first unread message

tshim

unread,
Apr 29, 2010, 4:44:11 PM4/29/10
to Haml

In a new Rails 2.3.5 / Haml 2.23 / haml-edge 2.3.67 project my
generated functional tests are whining:

1) Error:
test_should_get_edit(RolesControllerTest):
ActionView::TemplateError: undefined method `check_encoding' for
#<Haml::Engine:0x18e19fc>
In app/views/roles/edit.html.haml


This doesn't happen when I just have .html.erb files in the relevant
view dir. Any idea why this error is being raised? Here's a sample
test:

require 'test_helper'

class RolesControllerTest < ActionController::TestCase

test "should get edit" do
get :edit, :id => roles(:one).to_param
assert_response :success
end

end

--
You received this message because you are subscribed to the Google Groups "Haml" group.
To post to this group, send email to ha...@googlegroups.com.
To unsubscribe from this group, send email to haml+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Nathan Weizenbaum

unread,
Apr 29, 2010, 4:48:19 PM4/29/10
to ha...@googlegroups.com
What's the backtrace?

tshim

unread,
Apr 29, 2010, 4:55:12 PM4/29/10
to Haml

Thanks for listening. Here's the full trace:

1) Error:
test_should_get_index(RolesControllerTest):
ActionView::TemplateError: undefined method `check_encoding' for
#<Haml::Engine:0x1abd118>
In app/views/roles/index.html.haml




/usr/local/lib/ruby/gems/1.8/gems/haml-edge-2.3.67/lib/haml/engine.rb:
100:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/haml-edge-2.3.67/lib/haml/template/
plugin.rb:21:in `new'
/usr/local/lib/ruby/gems/1.8/gems/haml-edge-2.3.67/lib/haml/template/
plugin.rb:21:in `compile'
/usr/local/lib/ruby/gems/1.8/gems/haml-edge-2.3.67/lib/haml/helpers/
action_view_mods.rb:13:in `render'
/usr/local/lib/ruby/gems/1.8/gems/haml-edge-2.3.67/lib/haml/helpers/
action_view_mods.rb:13:in `render'
app/controllers/roles_controller.rb:7:in `index'
/test/functional/roles_controller_test.rb:5:in `test_should_get_index'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`run_suite'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
`start_mediator'
/usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
`start'
/usr/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in
`run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
/usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
/usr/local/lib/ruby/1.8/test/unit.rb:278
-e:2

1 tests, 0 assertions, 0 failures, 1 errors

tshim

unread,
Apr 29, 2010, 5:03:10 PM4/29/10
to Haml

This has got to be a conflict with something in my current project, as
a blank project using haml doesn't do this.

I notice that when running autotest, it loads the haml-edge gem...
because I'm using compass, I assume.

tshim

unread,
Apr 29, 2010, 5:20:02 PM4/29/10
to Haml

Well poop, it's not compass.

tshim

unread,
Apr 29, 2010, 6:28:32 PM4/29/10
to Haml

A little rummaging through the commit history has revealed the issue.
In order to get around a stupid compass issue, I had an explicit
require in my environment.rb.

After removing "require 'compass'" from my config, tests are acting as
usual.

Here's my relevant whining in the compass group:

http://groups.google.com/group/compass-users/browse_thread/thread/4eb19b008422e6d2

Nathan Weizenbaum

unread,
Apr 29, 2010, 9:12:01 PM4/29/10
to ha...@googlegroups.com
All right, I'll leave this up to Chris to figure out.

Chris Eppstein

unread,
Apr 29, 2010, 9:21:40 PM4/29/10
to ha...@googlegroups.com, ha...@googlegroups.com
I think we sorted it out on the compass list today. It sounds like the rails template installer might not be working right -- I'll see if I can repro.   

Hunt & pecked on my iPhone... Sorry if it's brief!
Reply all
Reply to author
Forward
0 new messages