Sha256: d58545261b51a9bae0ce447a307567cd4ae07bd4ec432187e876555f84346b33

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

require 'spec_helper'

describe AuthStrategist::Authorization do
  let(:dummy_controller) { DummyController.new }

  context 'included' do
    it 'adds #authorize! method to base' do
      expect(dummy_controller).to respond_to(:authorize!)
    end

    describe '#authorize!' do
      let(:options) { Hash[:strategy, :dummy_strategy] }

      it 'calls authorization service with given options' do
        allow(AuthStrategist::Authorize).to receive(:call).with(options).and_return(:ok)
        expect(dummy_controller.authorize!(options)).to eq(:ok)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auth_strategist-0.6.0 spec/authorization_spec.rb
auth_strategist-0.5.0 spec/authorization_spec.rb