Plugins - ActiveTest Authorisation

StarAdd to favorites

ActiveTest Authorisation

Description

The ActiveTest Authorisation is an example, but fully functional, plugin for the ActiveTest::Controller subject. It gives you the ability to test that a controller’s action requires a user to have the correct permissions to access it.

It provides two behaviours (requires_permission_on and accepts_permission_on) and two assertions (assert_requires_permission and assert_accepts_permission).

It assumes the following:

  • You are using some variant of Simple Access Control or acl_system2.
  • You have login_as and logout methods for logging users in and out (e.g. ActiveTest Authentication)
  • You are probably using ActiveTest Authentication as well.

Example

  class SomeControllerTest < ActiveTest::Controller

    setup

    def setup
      login_as :admin
    end

    requires_permission_on :index, :login_as => :unprivileged
    accepts_permission_on :index

  end

mabs29

http://www.mathewabonyi.com/articles/2006/11/19/two-activetest-plugins/

http://mabs29.googlecode.com/svn/trunk/plugins/active_test_authorisation

Rails' (MIT)

  • Currently 3.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Testing

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?