Sha256: 84b31dec89ab8f9dc71f519d31dbdf8304670ac803fff732d5e068a7968f5a9d

Contents?: true

Size: 1.26 KB

Versions: 3

Compression:

Stored size: 1.26 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))

describe AController, " < TestController; inherit_views" do
  describe "(the class)" do
    it { AController.should be_inherit_views }

    it "should have inherit view paths == ['a']" do
      AController.inherit_view_paths.should == ['a']
    end
  end
  
  describe "(an instance)" do
    integrate_views
  
    it { @controller.should be_inherit_views }

    it "should have inherit view paths == ['a']" do
      @controller.class.inherit_view_paths.should == ['a']
    end
  
    it "GET :in_abc should render a/in_abc" do
      get :in_abc
      response.body.should == 'a:in_abc'
    end

    it "GET :in_a should render a/in_a" do
      get :in_a
      response.body.should == 'a:in_a'
    end

    it "GET :in_ab should render a/in_ab" do
      get :in_ab
      response.body.should == 'a:in_ab'
    end
    
    it "GET :render_non_existent_partial should raise ActionView::TemplateError" do
      lambda { get :render_non_existent_partial }.should raise_error(ActionView::TemplateError)
    end
    
    it "GET :render_non_existent_template should raise ActionView::MissingTemplate" do
      lambda { get :render_non_existent_template }.should raise_error(ActionView::MissingTemplate)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
topherfangio-inherit_views-1.0.1 spec/controllers/a_controller_spec.rb
topherfangio-inherit_views-1.0.2 spec/controllers/a_controller_spec.rb
topherfangio-inherit_views-1.0.3 spec/controllers/a_controller_spec.rb