Skip to content

vita/shoulda_macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Shoulda Macros

Shoulda macros for authorization testing:

should_be_authorized_for
should_be_authorized_for_actions
should_not_be_authorized_for
should_not_be_authorized_for_actions

Examples

context 'A competent user' do
  setup {login_as :admin}

  should_be_authorized_for_actions :index, :new, [:edit, {:id => 1}]

end

context 'An uncompetent user' do
  setup {login_as :test}

  should_not_be_authorized_for_actions :index,
                                       :new,
                                       [:edit, {:id => 1}],
                                       [:create, {:method => :post}],
                                       [:update, {:method => :put, :id =>11}]
end

TODO

Comments and Readme

About

Should macros for authorization testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages