Sha256: c01466423227960efb64e17bc089e6b3184221932784650759cf803b1f756b96

Contents?: true

Size: 1.44 KB

Versions: 17

Compression:

Stored size: 1.44 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  class ControllerTestClass

    include Vedeu::Controller

    controller :some_controller
    action :some_action

  end # ControllerTestClass

  describe Controller do

    let(:described)          { Vedeu::Controller }
    let(:included_described) { Vedeu::ControllerTestClass }

    it { included_described.must_respond_to(:controller_name) }
    it { included_described.must_respond_to(:action_name) }
    it { included_described.must_respond_to(:controller) }
    it { included_described.must_respond_to(:action) }

    describe '.controller' do
      subject { included_described.controller(:some_controller) }

      it do
        Vedeu::Runtime::Router.expects(:add_controller).
          with(:some_controller, 'Vedeu::ControllerTestClass')
        subject
      end

      it { subject.must_be_instance_of(Hash) }
    end

    describe '.action' do
      subject { included_described.action(:some_action, :other_action) }

      it do
        Vedeu::Runtime::Router.expects(:add_action).
          with(:some_controller, :some_action)
        Vedeu::Runtime::Router.expects(:add_action).
          with(:some_controller, :other_action)
        subject
      end

      it { subject.must_be_instance_of(Array) }
    end

    describe '.included' do
      subject { described.included(included_described) }

      it { subject.must_be_instance_of(Class) }
    end

  end # Controller

end # Vedeu

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
vedeu-0.8.32 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.31 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.30 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.29 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.28 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.27 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.26 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.25 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.24 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.23 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.22 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.21 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.20 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.19 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.18 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.17 test/lib/vedeu/application/controller_test.rb
vedeu-0.8.16 test/lib/vedeu/application/controller_test.rb