Sha256: ab4d0dfb7d2781454b651b62d3cce8639385ded2cf2006db588247be1911be37

Contents?: true

Size: 523 Bytes

Versions: 18

Compression:

Stored size: 523 Bytes

Contents

require 'spec_helper'
require 'doorkeeper/oauth/helpers/unique_token'

module Doorkeeper::OAuth::Helpers
  describe UniqueToken do
    let :generator do
      lambda { |size| "a" * size }
    end

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

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

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
doorkeeper-1.0.0.rc2 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-1.0.0.rc1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.7.4 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.7.3 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.7.2 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.7.1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.7.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.7 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.6 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.5 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.4 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.3 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.2 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.6.0.rc1 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.5.0 spec/lib/oauth/helpers/unique_token_spec.rb
doorkeeper-0.5.0.rc1 spec/lib/oauth/helpers/unique_token_spec.rb