Sha256: 5f8ab83878d855d7da0626899d446a2d7844c52cad7e8c0915e97a1ca776f9dc

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

require 'spec_helper'

describe Arrthorizer::Rails::ControllerAction do
  describe :get_current do
    let(:controller) { double('controller') }

    before :each do
      allow(Arrthorizer::Rails::ControllerAction).to receive(:key_for).with(controller).and_return("controller#action")
    end

    context "when there is no configuration for the current action" do
      let(:expected_error) { Arrthorizer::Rails::ControllerAction::ActionNotConfigured }

      specify "an ActionNotConfigured exception is raised" do
        expect {
          Arrthorizer::Rails::ControllerAction.get_current(controller)
        }.to raise_error(expected_error)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arrthorizer-0.3.2 spec/rails/controller_action/get_current_spec.rb