Sha256: 294be413855720611e9bdcff6c5667cf4ba4d8c427842045a734e74c93ba0ee5

Contents?: true

Size: 1.27 KB

Versions: 11

Compression:

Stored size: 1.27 KB

Contents

require "spec_helper"

require_relative 'shared_examples/finding_the_right_role.rb'

describe Arrthorizer::Role do
  describe :get do
    describe "fetching ContextRoles" do
      let(:expected_role) { Namespaced::ContextRole.instance } # provided by the internal Rails app

      context "when a ContextRole class is provided" do
        it_behaves_like "finding the right Role" do
          let(:arg) { expected_role.class }
        end
      end

      context "when a String representing a ContextRole instance is provided" do
        it_behaves_like "finding the right Role" do
          let(:arg) { expected_role.to_key }
        end
      end

      context "when a ContextRole instance is provided" do
        it_behaves_like "finding the right Role" do
          let(:arg) { expected_role }
        end
      end
    end

    context "fetching Groups" do
      let(:expected_role) { SomeGroup } # provided by the internal Rails app

      context "when a Group is provided" do
        it_behaves_like "finding the right Role" do
          let(:arg) { expected_role }
        end
      end

      context "when a String representing a Group is provided" do
        it_behaves_like "finding the right Role" do
          let(:arg) { expected_role.to_key }
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
arrthorizer-0.4.2 spec/role/get_spec.rb
arrthorizer-0.4.1 spec/role/get_spec.rb
arrthorizer-0.3.2 spec/role/get_spec.rb
arrthorizer-0.3.1 spec/role/get_spec.rb
arrthorizer-0.3.0 spec/role/get_spec.rb
arrthorizer-0.2.1 spec/role/get_spec.rb
arrthorizer-0.2.0 spec/role/get_spec.rb
arrthorizer-0.1.3 spec/role/get_spec.rb
arrthorizer-0.1.2 spec/role/get_spec.rb
arrthorizer-0.1.1 spec/role/get_spec.rb
arrthorizer-0.1.0 spec/role/get_spec.rb