require File.expand_path(File.dirname(__FILE__) + '/test_helper') class TestSlimRails < ActionController::IntegrationTest test "normal view" do get "slim/normal" assert_response :success assert_template ["slim/normal", "layouts/application"] assert_html "

Hello Slim!

" end test "normal erb view" do get "slim/erb" assert_html "

Hello Erb!

" end test "view without a layout" do get "slim/no_layout" assert_template "slim/no_layout" assert_html "

Hello Slim without a layout!

", :skip_layout => true end test "view with variables" do get "slim/variables" assert_html "

Hello Slim with variables!

" end test "partial view" do get "slim/partial" assert_html "

Hello Slim!

With a partial!

" end test "render integers" do get "slim/integers" assert_html "

1337

" end test "render nil" do get "slim/nil" assert_html "

" end test "content_for" do get "slim/content_for" assert_html "Heading set from a view

Page content

Hello Slim!

Hello Slim!

" end test "nested_attributes_form" do post "parents", 'parent[name]' => "p1", 'parent[children_attributes][0][name]' => "c1" get "parents/1/edit" assert_html '
'+ '
'+ '

Parent

'+ '

Children

'+ ''+ '
' end protected def assert_html(expected, options = {}) expected = "Dummy#{expected}" unless options[:skip_layout] assert_equal expected, @response.body end end