Sha256: 009f74530d6b9ce847d9228562da74575014ed912ba0d0e81383abe43d2a5756

Contents?: true

Size: 856 Bytes

Versions: 4

Compression:

Stored size: 856 Bytes

Contents

require 'spec_helper'

module Happy
  describe Controller::Cascadable do

    describe '#method_missing' do
      it "passes on all method calls to a parent if there is one" do
        class Inner < Controller
          def route
            on 'one' do
              some_helper
            end

            on 'two' do
              some_unknown_helper
            end
          end
        end

        class Middle < Controller
          def route
            run Inner
          end
        end

        class Outer < Controller
          def some_helper; 'some_information'; end
          def route
            run Middle
          end
        end

        def app
          Outer
        end

        response_for { get '/one' }.body.should == 'some_information'
        response_for { get '/two' }.status.should == 500
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
happy-0.1.0.pre27 spec/controller/cascadable_spec.rb
happy-0.1.0.pre25 spec/controller/cascadable_spec.rb
happy-0.1.0.pre24 spec/controller/cascadable_spec.rb
happy-0.1.0.pre23 spec/controller/cascadable_spec.rb