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
resource_controller-0.5.2 test/test/unit/helpers_test.rb
spree-0.4.0 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.4.1 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.5.0 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.6.0 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.5.1 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.7.0 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.7.1 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.8.0 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.8.1 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.8.2 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb
spree-0.8.3 vendor/plugins/resource_controller/test/test/unit/helpers_test.rb