Sha256: 3db7b23aa6430eb01ccdc617269cfbfecf7f61333fc447ff0167022e9bdab6c3
Contents?: true
Size: 1.35 KB
Versions: 8
Compression:
Stored size: 1.35 KB
Contents
require 'test_helper' class RailsViewTest < MiniTest::Spec include Cell::TestCase::TestMethods describe "A cell view" do # DISCUSS: it we allow :partial from a state, too? describe "calling render :partial" do it "render the local cell partial in bassist/dii" do assert_equal("Dii", in_view(:bassist) do render :partial => 'dii' end) end it "render the foreign cell partial in bad_guitarist/dii" do assert_equal("Dooom", in_view(:bassist) do render :partial => "bad_guitarist/dii" end) end it "render the global partial app/views/shared/dong" do class PercussionistCell < BassistCell append_view_path("test/app/views") end assert_equal("Dong!", in_view("rails_view_test/percussionist") do render :partial => "shared/dong" end) end end it "respond to render :state" do assert_equal("Doo", in_view(:bassist) do render :state => :play end) end it "respond to render :state with options" do BassistCell.class_eval do def listen(*args) render :text => "Listening to #{args.join(' ')}" end end assert_equal("Listening to Much the Same", in_view(:bassist) do render({:state => :listen}, "Much", "the", "Same") end) end end end
Version data entries
8 entries across 8 versions & 2 rubygems