Sha256: c9230de264470a57bba85389e490d5f7b56d27abee49ddf09ab29a65d9a0fbcc

Contents?: true

Size: 593 Bytes

Versions: 33

Compression:

Stored size: 593 Bytes

Contents

module Ddr::Auth
  RSpec.describe AbilityFactory do

    describe ".call" do
      subject { described_class.call(user, env) }

      describe "anonymous context" do
        let(:user) { nil }
        let(:env) { Hash.new }
        it { is_expected.to be_a(AnonymousAbility) }
      end

      describe "superuser context" do
        let(:user) { FactoryGirl.create(:user) }
        let(:env) { Hash.new }
        before {
          allow_any_instance_of(AuthContext).to receive(:superuser?) { true }
        }
        it { is_expected.to be_a(SuperuserAbility) }
      end
    end

  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
ddr-models-2.11.0 spec/auth/ability_factory_spec.rb
ddr-models-2.10.2 spec/auth/ability_factory_spec.rb
ddr-models-2.10.1 spec/auth/ability_factory_spec.rb
ddr-models-2.10.0 spec/auth/ability_factory_spec.rb
ddr-models-2.10.0.rc2 spec/auth/ability_factory_spec.rb
ddr-models-2.10.0.rc1 spec/auth/ability_factory_spec.rb
ddr-models-2.9.2 spec/auth/ability_factory_spec.rb
ddr-models-2.9.1 spec/auth/ability_factory_spec.rb
ddr-models-2.9.0 spec/auth/ability_factory_spec.rb
ddr-models-2.9.0.rc1 spec/auth/ability_factory_spec.rb
ddr-models-2.8.0 spec/auth/ability_factory_spec.rb
ddr-models-2.8.0.rc1 spec/auth/ability_factory_spec.rb
ddr-models-2.7.6 spec/auth/ability_factory_spec.rb
ddr-models-2.7.5 spec/auth/ability_factory_spec.rb
ddr-models-2.7.4 spec/auth/ability_factory_spec.rb
ddr-models-2.7.3 spec/auth/ability_factory_spec.rb
ddr-models-2.7.2 spec/auth/ability_factory_spec.rb
ddr-models-2.7.1 spec/auth/ability_factory_spec.rb
ddr-models-2.7.0 spec/auth/ability_factory_spec.rb
ddr-models-2.7.0.rc1 spec/auth/ability_factory_spec.rb