test/unit/trust/controller/resource_test.rb in trust-0.8.2 vs test/unit/trust/controller/resource_test.rb in trust-0.8.3
- old
+ new
@@ -258,11 +258,11 @@
@resource_info.expects(:collection).with(@parent_info, 2).returns(3)
assert_equal 3, @resource.collection(2)
end
should 'load as expected' do
@resource_info.stubs(:params).returns({})
- @controller.expects(:respond_to?).with(:build).returns(false)
+ @controller.expects(:respond_to?).with(:build,true).returns(false)
@resource.load
assert_equal 6, @controller.instance_variable_get(:@parent)
assert_equal 6, @resource.parent
assert @controller.instance_variable_get(:@child).is_a?(Child)
assert @resource.instance.is_a?(Child)
@@ -275,11 +275,11 @@
end
should 'load as expected' do
@resource = Trust::Controller::Resource.new(@controller, @properties, 'member',{ :id => 1 }, @request)
@properties.actions :member => [:member]
@resource_info.stubs(:params).returns({})
- @controller.expects(:respond_to?).with(:build).returns(false)
+ @controller.expects(:respond_to?).with(:build,true).returns(false)
Child.expects(:find).with(1).returns(Child.new)
@resource.load
assert_equal 6, @controller.instance_variable_get(:@parent)
assert_equal 6, @resource.parent
assert @controller.instance_variable_get(:@child).is_a?(Child)
@@ -293,10 +293,10 @@
end
should 'load as expected' do
@resource = Trust::Controller::Resource.new(@controller, @properties, 'member',{ :child_id => 1 }, @request)
@properties.actions :member => [:member]
@resource_info.stubs(:params).returns({})
- @controller.expects(:respond_to?).with(:build).returns(false)
+ @controller.expects(:respond_to?).with(:build,true).returns(false)
Child.expects(:find).with(1).returns(Child.new)
@resource.load
assert_equal 6, @controller.instance_variable_get(:@parent)
assert_equal 6, @resource.parent
assert @controller.instance_variable_get(:@child).is_a?(Child)