Sha256: f8054df113685bfa9411dc9af16289e400cd6af92c1bf7b086114ac38cbd80c2

Contents?: true

Size: 1.28 KB

Versions: 21

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

describe TheSortableTreeController do
  describe "common variable definitions" do
    class BigTest; end

    module ParentModule
      class TestsController < ApplicationController
        include TheSortableTreeController::Rebuild
      end

      class BigTestsController < ApplicationController
        include TheSortableTreeController::Rebuild
      end
    end

    before do
      @test_controller = TestsController.new
      @variable, @collection, @klass = @test_controller.the_define_common_variables 
    end

    it "should define collection" do
      @collection.should == 'tests'
    end

    describe "namespaced controllers" do
      before do
        @test_controller = ParentModule::TestsController.new
        @variable, @collection, @klass = @test_controller.the_define_common_variables 
      end

      it "should handle namespaced collections" do
        @collection.should == 'tests'
      end

    end

    describe "camel cased and namespaced controllers" do
      before do
        @test_controller = ParentModule::BigTestsController.new
        @variable, @collection, @klass = @test_controller.the_define_common_variables 
      end

      it "should handle namespaced collections" do
        @collection.should == 'big_tests'
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
the_sortable_tree-2.3.2 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-2.3.1 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-2.3.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-2.2.1 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-2.2.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-2.1.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-2.0.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree_mongoid-1.8.5.1 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree_mongoid-1.8.5 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.9.4 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.9.3 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.9.2 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.9.1 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.9.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.8.6 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.8.5 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.8.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.7.1 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.7.0 spec/controlllers/controller_mixin_spec.rb
the_sortable_tree-1.6.0 spec/controlllers/controller_mixin_spec.rb