Sha256: 8f7c832e58de76fb7f94aa727c6a3168f7c63f0b31a7877603cf860a2f638b10

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

require 'spec_helper'

describe Authorization do
  describe 'authorized_for?' do
    it 'should return true if the permission exists and its value is true' do
      Authorization.stub(:permissions){ {action: true} }
      Authorization.authorized_for?(:action).should == true
    end

    it 'should return false if the permission does not exists or its value is false' do
      Authorization.stub(:permissions){ {action: false} }
      Authorization.authorized_for?(:action).should == false
      Authorization.authorized_for?(:action2).should == false
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis_monitor-0.1 spec/modules/security/authorization_spec.rb
redis_monitor-0.0.6 spec/modules/security/authorization_spec.rb