Sha256: 93d4c2290d175c5c2288cee56559f4a10067c9bd75fceccd06c14415b7cb013f

Contents?: true

Size: 778 Bytes

Versions: 6

Compression:

Stored size: 778 Bytes

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')
load File.join File.dirname(__FILE__), 'spec_models.rb'

describe Permissive, "`has_permissions' default class method" do
  before :each do
    PermissiveSpecHelper.db_up
  end

  [Permissive::User, Permissive::Organization].each do |model|
    before :each do
      model.has_permissions do
        on :organizations
      end
    end

    describe model do
      it "should create a permissions reflection" do
        model.new.should respond_to(:permissions)
      end

      it "should create a `can?' method" do
        model.new.should respond_to(:can?)
      end

      it "should create a `revoke' method" do
        model.new.should respond_to(:revoke)
      end
    end
  end
end

PermissiveSpecHelper.clear_log

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
permissive-0.2.9.alpha spec/has_permissions_spec.rb
permissive-0.2.8.alpha spec/has_permissions_spec.rb
permissive-0.2.7.alpha spec/has_permissions_spec.rb
permissive-0.2.6.alpha spec/has_permissions_spec.rb
permissive-0.2.5.alpha spec/has_permissions_spec.rb
permissive-0.2.4.alpha spec/has_permissions_spec.rb