Sha256: adbc8e4463fd16554db9d3dff483fc30ea861f7dc00eb9d232337b491fdc720f

Contents?: true

Size: 642 Bytes

Versions: 32

Compression:

Stored size: 642 Bytes

Contents

require File.dirname(__FILE__)+'/../test_helper'

class HelpersTest < Test::Unit::TestCase
  
  def setup
    @controller = PostsController.new

    @params = stub :[] => "1"
    @controller.stubs(:params).returns(@params)

    @object = Post.new
    Post.stubs(:find).with("1").returns(@object)
    
    @collection = mock()
    Post.stubs(:find).with(:all).returns(@collection)
  end
  
  ResourceController::NAME_ACCESSORS.each do |accessor|
    context "#{accessor} accessor" do
      should "default to returning the singular name of the controller" do
        assert_equal "post", @controller.send(accessor)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
akitaonrails-resource_controller-0.5.2 test/test/unit/helpers_test.rb
akitaonrails-resource_controller-0.5.3 test/test/unit/helpers_test.rb
giraffesoft-resource_controller-0.4.10 test/test/unit/helpers_test.rb
giraffesoft-resource_controller-0.4.12 test/test/unit/helpers_test.rb
giraffesoft-resource_controller-0.4.9 test/test/unit/helpers_test.rb
giraffesoft-resource_controller-0.5.2 test/test/unit/helpers_test.rb
giraffesoft-resource_controller-0.5.3 test/test/unit/helpers_test.rb
korin-resource_controller-0.5.3 test/test/unit/helpers_test.rb
nileshtrivedi-lp_resource_builder-0.5.1 test/test/unit/helpers_test.rb
nileshtrivedi-lp_resource_builder-0.5.3 test/test/unit/helpers_test.rb
nileshtrivedi-safe_resource-0.5.3 test/test/unit/helpers_test.rb
pager-resource_controller-1.0.20080513 test/test/unit/helpers_test.rb
spree-0.11.4 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.11.3 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.8.4 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.8.5 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
resource_controller-0.4.9 test/test/unit/helpers_test.rb
resource_controller-0.5.1 test/test/unit/helpers_test.rb
resource_controller-0.5.3 test/test/unit/helpers_test.rb
resource_controller-0.5.0 test/test/unit/helpers_test.rb