test/unit/trust/controller/properties_test.rb in trust-0.8.3 vs test/unit/trust/controller/properties_test.rb in trust-1.4.2
- old
+ new
@@ -95,9 +95,24 @@
@properties.actions(:add => {:new => :yes, :member => :no, :collection => :maybe}, :except => [:yes, :no, :maybe])
assert_equal [:new, :create], @properties.new_actions
assert_equal [:show, :edit, :update, :destroy], @properties.member_actions
assert_equal [:index], @properties.collection_actions
end
+ should 'discover new_action?' do
+ assert @properties.new_action?( :new)
+ assert @properties.new_action?( 'new')
+ assert !@properties.new_action?( :show)
+ end
+ should 'discover collection_action?' do
+ assert @properties.collection_action?( :index)
+ assert @properties.collection_action?( 'index')
+ assert !@properties.collection_action?( :show)
+ end
+ should 'discover member_action?' do
+ assert @properties.member_action?( :show)
+ assert @properties.member_action?( 'show')
+ assert !@properties.member_action?( :index)
+ end
end
context 'belongs_to' do
setup do
@properties = Trust::Controller::Properties.instantiate(Controller)