Sha256: cd397e72f3d44c1d96ab2e805d26d5c1d9e449b50c8b782c3050845208bdc895

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 Bytes

Contents

require "spec_helper"

describe Arrthorizer::Rails::ControllerConcern do
  let(:controller_class) { Class.new(SomeController) }
  let(:controller) { controller_class.new }

  before :each do
    controller_class.to_prepare_context do |c|
      c.defaults do
        params
      end
    end

    controller.stub(:request).and_return(ActionDispatch::TestRequest.new)
  end

  describe :arrthorizer_context do
    it "returns an Arrthorizer::Context" do
      context = controller.send(:arrthorizer_context)

      expect(context).to be_a Arrthorizer::Context
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arrthorizer-0.3.1 spec/rails/controller_concern/arrthorizer_context_spec.rb
arrthorizer-0.3.0 spec/rails/controller_concern/arrthorizer_context_spec.rb
arrthorizer-0.2.1 spec/rails/controller_concern/arrthorizer_context_spec.rb
arrthorizer-0.2.0 spec/rails/controller_concern/arrthorizer_context_spec.rb