Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add missing file

  • Loading branch information...
commit dc1b3c4d0e30e641ee90f9260616628173c54dfe 1 parent ae9284a
@dnagir authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 spec/rspec_spec.rb
View
27 spec/rspec_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+require 'allowy/rspec'
+
+module Allowy
+ describe ControllerAuthorizationMacros do
+ include ControllerAuthorizationMacros
+ before { @controller = stub("FakeController") }
+
+ ignore_authorization!
+
+ it "aliases allowy as the current_allowy of the controller" do
+ allowy.should === @controller.current_allowy
+ end
+
+ describe "authorize_for matcher" do
+ it "works when authorised" do
+ should_authorize_for(:create, 123)
+ allowy.authorize!(:create, 123)
+ end
+ it "works when not authorised" do
+ should_not_authorize_for(:create, 123)
+ allowy.authorize!(:edit, 123)
+ end
+ end
+
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.