Sha256: 840ec75f32cd8089559d7a280f4c86e568ca1d4d7936563a3d9ac06bb5e30da1

Contents?: true

Size: 722 Bytes

Versions: 1

Compression:

Stored size: 722 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe Walruz::Manager do

  describe "#check_authorization" do 

    it "should invoke the policies associated to an action on a subject performed by an actor" do
      result = Walruz::Manager.check_action_authorization(Beatle::JOHN, :sing, Song::ALL_YOU_NEED_IS_LOVE)
      result[0].should be_true
    end

    describe "when executing validations on an invalid subject" do

      it "should raise an Walruz::AuthorizationActionsNotDefined error" do
        lambda do
          Walruz::Manager.check_action_authorization(Beatle::JOHN, :talk_with, Beatle::PAUL)
        end.should raise_error(Walruz::AuthorizationActionsNotDefined)
      end

    end

  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
walruz-0.0.9 spec/walruz/manager_spec.rb