Sha256: c75ac242a287d399f961519f208fdf7de31bc18da7e4bfb1c5e0707d13102565

Contents?: true

Size: 1.05 KB

Versions: 24

Compression:

Stored size: 1.05 KB

Contents

require "spec_helper"

describe "Abstract" do
  with_view_path "#{spec_dir}/views"
  with_abstract_controller  
  
  after :all do
    remove_constants %w(
      SomeHelperSpec
      HelperSpec
      HelperMethodSpec      
    )
  end
  
  it "helper_method" do
    class ::HelperMethodSpec
      inherit Rad::Controller::Abstract
      
      def some_controller_method
        "some controller value (rendered in cotext of #{self.class})"
      end
      helper_method :some_controller_method
      
      def action; end
    end
        
    ccall(HelperMethodSpec, :action).should == "some controller value (rendered in cotext of HelperMethodSpec)"
  end
  
  it "helper" do
    module ::SomeHelperSpec
      def wiget
        "some wighet (rendered in context of #{self.class.name})"
      end
    end
    
    class ::HelperSpec
      inherit Rad::Controller::Abstract
      
      helper SomeHelperSpec
      
      def action; end
    end
    
    ccall(HelperSpec, :action).should == "some wighet (rendered in context of HelperSpec::HelperSpecContext)"
  end  
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rad_core-0.2.6 spec/controller/helper_spec.rb
rad_core-0.2.5 spec/controller/helper_spec.rb
rad_core-0.2.4 spec/controller/helper_spec.rb
rad_core-0.2.3 spec/controller/helper_spec.rb
rad_core-0.2.2 spec/controller/helper_spec.rb
rad_core-0.2.1 spec/controller/helper_spec.rb
rad_core-0.2.0 spec/controller/helper_spec.rb
rad_core-0.0.30 spec/controller/helper_spec.rb
rad_core-0.0.29 spec/controller/helper_spec.rb
rad_core-0.0.28 spec/controller/helper_spec.rb
rad_core-0.0.27 spec/controller/helper_spec.rb
rad_core-0.0.26 spec/controller/helper_spec.rb
rad_core-0.0.25 spec/controller/helper_spec.rb
rad_core-0.0.24 spec/controller/helper_spec.rb
rad_core-0.0.23 spec/controller/helper_spec.rb
rad_core-0.0.22 spec/controller/helper_spec.rb
rad_core-0.0.21 spec/controller/helper_spec.rb
rad_core-0.0.20 spec/controller/helper_spec.rb
rad_core-0.0.19 spec/controller/helper_spec.rb
rad_core-0.0.18 spec/controller/helper_spec.rb