diff --git a/test/unit/manage_products_helper_test.rb b/test/unit/manage_products_helper_test.rb index c6af7d4..ef1f965 100644 --- a/test/unit/manage_products_helper_test.rb +++ b/test/unit/manage_products_helper_test.rb @@ -101,7 +101,7 @@ class ManageProductsHelperTest < ActionView::TestCase category = fast_create(ProductCategory, :name => 'Category 1', :environment_id => @environment.id) product = fast_create(Product, :product_category_id => category.id) - expects(:ui_button_to_remote).with('link to edit', {:update => "product-info", :loading => "loading_for_button('#edit-product-remote-button-ui-info')", :url => {:controller => 'manage_products', :action => 'edit', :id => product.id, :field => 'info'}, :complete => "$('edit-product-button-ui-info').hide()", :method => :get}, :id => 'edit-product-remote-button-ui-info').returns('LINK') + expects(:ui_button_to_remote).with('link to edit', {:update => "product-info", :loading => "loading_for_button('#edit-product-remote-button-ui-info')", :url => {:controller => 'manage_products', :action => 'edit', :id => product.id, :field => 'info'}, :complete => "$('#edit-product-button-ui-info').hide()", :method => :get}, :id => 'edit-product-remote-button-ui-info').returns('LINK') assert_equal 'LINK', edit_product_ui_button_to_remote(product, 'info', 'link to edit') end diff --git a/vendor/plugins/access_control/lib/permission_check.rb b/vendor/plugins/access_control/lib/permission_check.rb index c115e52..236332b 100644 --- a/vendor/plugins/access_control/lib/permission_check.rb +++ b/vendor/plugins/access_control/lib/permission_check.rb @@ -1,5 +1,5 @@ module PermissionCheck - + module ClassMethods # Declares the +permission+ need to be able to access +action+. # @@ -8,15 +8,15 @@ module PermissionCheck # * +target+ is the object over witch the user would need the specified # permission and must be specified as a symbol or the string 'global'. The controller using # +target+ must respond to a method with that name returning the object - # against which the permissions needed will be checked or if 'global' is passed it will be + # against which the permissions needed will be checked or if 'global' is passed it will be # cheked if the assignment is global # * +accessor+ is a mehtod that returns the accessor who must have the permission. By default # is :user - # * +action+ must be a hash of options for a before filter like + # * +action+ must be a hash of options for a before filter like # :only => :index or :except => [:edit, :update] by default protects all the actions def protect(permission, target_method, accessor_method = :user, actions = {}) actions, accessor_method = accessor_method, :user if accessor_method.kind_of?(Hash) - before_filter actions do |c| + before_filter actions do |c| target = target_method.kind_of?(Symbol) ? c.send(target_method) : target_method accessor = accessor_method.kind_of?(Symbol) ? c.send(accessor_method) : accessor_method unless accessor && accessor.has_permission?(permission.to_s, target) @@ -34,12 +34,12 @@ module PermissionCheck end def access_denied_template_path - if File.exists?(File.join(Rails.root, 'app', 'views', 'access_control', 'access_denied.rhtml')) - File.join(Rails.root, 'app', 'views', 'access_control', 'access_denied.rhtml') - elsif File.exists?(File.join(Rails.root, 'app','views', 'shared', 'access_denied.rhtml')) - File.join('shared', 'access_denied.rhtml') + if File.exists?(File.join(Rails.root, 'app', 'views', 'access_control', 'access_denied.html.erb')) + File.join(Rails.root, 'app', 'views', 'access_control', 'access_denied.html.erb') + elsif File.exists?(File.join(Rails.root, 'app','views', 'shared', 'access_denied.html.erb')) + File.join('shared', 'access_denied.html.erb') else - File.join(File.dirname(__FILE__), '..', 'views', 'access_denied.rhtml') + File.join(File.dirname(__FILE__), '..', 'views', 'access_denied.html.erb') end end end -- libgit2 0.21.2