Sha256: e92157ac56f1c6f33dd49cd3f8d146ae9c19c4e6f93bea89ba3712e9d1d44863

Contents?: true

Size: 502 Bytes

Versions: 22

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Doorkeeper::OAuth::Helpers
  describe UniqueToken do
    let :generator do
      ->(size) { "a" * size }
    end

    it "is able to customize the generator method" do
      token = UniqueToken.generate(generator: generator)
      expect(token).to eq("a" * 32)
    end

    it "is able to customize the size of the token" do
      token = UniqueToken.generate(generator: generator, size: 2)
      expect(token).to eq("aa")
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
doorkeeper-5.1.2 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.6 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.3.3 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.1.1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.5 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.3.2 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.4.0.rc1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-mongodb-5.2.1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-mongodb-5.2.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-sequel-2.2.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.4 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.3.1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.3.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.3 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.2 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-sequel-2.1.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.0.rc3 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-5.2.0.rc2 spec/lib/oauth/helpers/unique_token_spec.rb