Sha256: c2517dbe18c66425642d7907fba9c43cfb0fe67ce28e9e9d41ab2ea7ff023859
Contents?: true
Size: 1.71 KB
Versions: 1
Compression:
Stored size: 1.71 KB
Contents
require File.join(File.dirname(__FILE__), 'test_helper') ### DISCUSS: how can we limit that test to systems where ActiveHelper's around? class ActiveHelperTest < ActiveSupport::TestCase context "The Cell::Base class" do setup do require 'active_helper' require 'active_helper/rails' class FingeringHelper < ActiveHelper::Base provides :finger end class SlappingHelper < ActiveHelper::Base provides :slap end end should "respond to active_helper" do assert_respond_to Cell::Base, :active_helper end should "store helper constants from active_helper" do @cell = Class.new(BassistCell) @cell.active_helper SlappingHelper assert_equal [SlappingHelper], @cell.active_helpers end should "inherit helper constants from active_helper" do @base_cell = Class.new(BassistCell) @base_cell.active_helper SlappingHelper @cell = Class.new(@base_cell) @cell.active_helper FingeringHelper assert_equal [SlappingHelper, FingeringHelper], @cell.active_helpers end context "An Cell::View::Base instance" do should_eventually "respond to use" do # we didn't extend the view at this point. @view = bassist_mock.setup_action_view assert_respond_to @view, :use end end context "The view rendered by the cell" do should "respond to used helper methods" do @cell = bassist_mock @cell.class.active_helper SlappingHelper @view = @cell.setup_action_view @cell.prepare_action_view_for(@view, {}) assert_respond_to @view, :slap # from the SlappingHelper end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cells-3.4.0.beta1 | test/active_helper_test.rb |