require 'test_helper' class SlimTest < MiniTest::Spec let (:controller) { ApplicationController.new.tap { |ctl| ctl.send("request=", ActionDispatch::Request.new({})) } } let (:song_cell) { SongCell.new(controller) } # render in render it("bla") { song_cell.(:render_in_render).must_equal "Questions: Yes!" } # content_tag { } it { song_cell.(:with_content_tag).must_equal "
Beachparty
" } # content_tag { content_tag { } } it do song_cell.(:with_content_tag_and_content_tag).must_equal %{Title:
Still Knee Deep
} end # form_tag { content_tag { } } it( "xxx") do form_tag = "
" form_tag = "
" if ActionPack::VERSION::MAJOR == 3 input_tag = %{} input_tag = "" if ActionPack::VERSION::MAJOR == 3 form_with_body_tag = "
" form_with_body_tag = "
" if ActionPack::VERSION::MAJOR == 3 form_for_tag = "
" form_for_tag = "
" if ActionPack::VERSION::MAJOR == 3 song_cell.(:with_form_tag_and_content_tag).must_equal %{Word. #{form_tag} #{input_tag} hallo
Cool
Weiter! Bonjour! Coffee? Yes please! 1+2 No current page! #{form_with_body_tag} #{form_for_tag}

Concat!

Whoo
}.gsub("\n", "").gsub(" ", "") end it 'allows concatenation chains' do song_cell.capture do song_cell.concat('Lorem').concat('ipsum') end end describe "block capture" do it do song_cell.(:with_capture).must_equal %{Hallo

More

Hidden!} end end end