require File.expand_path('../helper', __FILE__) class TestSlim < ActionDispatch::IntegrationTest test "normal view" do get "slim/normal" assert_response :success assert_template ["slim/normal", "layouts/application"] assert_html "
With a partial!
" end if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR >= 1 && Object.const_defined?(:Fiber) puts 'Streaming test enabled' test "streaming" do get "slim/streaming" output = "2f\r\nPage content
Hello Streaming!
Hello Streaming!
\r\n14\r\n1337
" end test "render nil" do get "slim/nil" assert_html "" end test "content_for" do get "slim/content_for" assert_html "Page content
Hello Slim!
Hello Slim!
", :heading => 'Heading set from a view' end test "nested_attributes_form" do post "parents", 'parent[name]' => "p1", 'parent[children_attributes][0][name]' => "c1" get "parents/1/edit" assert_match(%r{}, @response.body) end protected def assert_html(expected, options = {}) expected = "