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_with_body_tag = "" if ActionPack::VERSION::MAJOR == 3
form_for_tag = "
Weiter!
Bonjour!
Coffee?
Yes please!
1+2
No current page!
#{form_with_body_tag}
#{form_for_tag}
}.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 %{HalloMore
Hidden!}
end
end
end