Sha256: 95c2f9e52f7fc25acd1bbc6ec14daf39fbe57f7d7693fefbc1d23edde1777a09

Contents?: true

Size: 697 Bytes

Versions: 37

Compression:

Stored size: 697 Bytes

Contents

require 'spec_helper'

describe ApiToken do
  before(:each) do
    IuguSDK::account_api_tokens = [ 'test', 'live' ]
    Fabricate(:api_token)
  end

  it { should validate_uniqueness_of(:token) }
  it { should validate_presence_of(:description) }
  it { should validate_presence_of(:tokenable) }

  it 'description should be unique for each tokenable record' do
    @acc = Fabricate(:account)
    @acc.tokens.create(description: "token 1", api_type: 'test').should be_valid
    @acc.tokens.create(description: "token 1", api_type: 'live').should_not be_valid
  end

  it 'api_type should be supported' do
    Fabricate.build(:api_token, api_type: 'not supported').should_not be_valid
  end
  
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
iugusdk-1.0.11 spec/models/api_token_spec.rb
iugusdk-1.0.10 spec/models/api_token_spec.rb
iugusdk-1.0.9 spec/models/api_token_spec.rb
iugusdk-1.0.8 spec/models/api_token_spec.rb
iugusdk-1.0.7 spec/models/api_token_spec.rb
iugusdk-1.0.6 spec/models/api_token_spec.rb
iugusdk-1.0.5 spec/models/api_token_spec.rb
iugusdk-1.0.4 spec/models/api_token_spec.rb
iugusdk-1.0.3 spec/models/api_token_spec.rb
iugusdk-1.0.2 spec/models/api_token_spec.rb
iugusdk-1.0.1 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.32 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.31 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.30 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.29 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.28 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.27 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.26 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.25 spec/models/api_token_spec.rb
iugusdk-1.0.0.alpha.24 spec/models/api_token_spec.rb