Sha256: b7c45ce2ae189f3b84a2945bfc069b8f96c924e26be81abdab65d2c8abf587f6

Contents?: true

Size: 625 Bytes

Versions: 36

Compression:

Stored size: 625 Bytes

Contents

require 'spec_helper'

describe CoalescingPanda::CanvasApiAuth do

  it { should validate_uniqueness_of(:user_id).scoped_to(:api_domain)}
  it { should validate_presence_of(:user_id)}
  it {should validate_presence_of(:api_domain)}

  describe '#expired?' do
    let(:auth) { FactoryGirl.create :canvas_api_auth }

    it 'is not expired if expires_at is null or in the future' do
      auth.expires_at = nil
      expect(auth.expired?).to be_falsey
      auth.expires_at = 1.hour.ago
      expect(auth.expired?).to be_truthy
      auth.expires_at = 1.hour.from_now
      expect(auth.expired?).to be_falsey
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
coalescing_panda-5.0.9 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.8 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.7 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.6 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.4 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.3 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.2 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.1 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.0 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.0.beta.2 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-5.0.0.beta.1 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.8.0.beta.1 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.7.0 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.6.1 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.6.0 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.6.0.rc3 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.6.0.rc2 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.6.0.rc1 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.5.7 spec/models/coalescing_panda/canvas_api_auth_spec.rb
coalescing_panda-4.5.6 spec/models/coalescing_panda/canvas_api_auth_spec.rb