Sha256: 8a88f17e3978a891dc027947a54a2737fcb51aee9b221f7e1725242d3bead6c1

Contents?: true

Size: 1.05 KB

Versions: 17

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'
require 'simple_token_authentication/adapters/rails_api_adapter'

describe 'SimpleTokenAuthentication::Adapters::RailsAPIAdapter' do

  before(:each) do
    stub_const('ActionController', Module.new)
    stub_const('ActionController::API', double())

    @subject = SimpleTokenAuthentication::Adapters::RailsAPIAdapter
  end

  it_behaves_like 'an adapter'

  describe '.base_class' do

    it 'is ActionController::API', private: true do
      expect(@subject.base_class).to eq ActionController::API
    end
  end
end

context 'When the "API" acronym is not defined' do
  describe 'SimpleTokenAuthentication::Adapters::RailsApiAdapter' do

    before(:each) do
      stub_const('ActionController', Module.new)
      stub_const('ActionController::API', double())

      @subject = SimpleTokenAuthentication::Adapters::RailsApiAdapter
    end

    it_behaves_like 'an adapter'

    describe '.base_class' do

      it 'is ActionController::API', private: true do
        expect(@subject.base_class).to eq ActionController::API
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
simple_token_authentication-1.18.1 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.18.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.17.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.16.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.15.1 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.15.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.14.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.13.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.12.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.11.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.10.1 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.10.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.9.1 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.9.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.8.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
stn-simple_token_authentication-1.7.1 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb
simple_token_authentication-1.7.0 spec/lib/simple_token_authentication/adapters/rails_api_adapter_spec.rb