This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2016-11-28 13:36:47 +01:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe Subscription, type: :model do
|
2017-05-02 18:21:22 +02:00
|
|
|
let(:alice) { Fabricate(:account, username: 'alice') }
|
2017-01-20 01:00:14 +01:00
|
|
|
|
2017-05-02 18:21:22 +02:00
|
|
|
subject { Fabricate(:subscription, account: alice) }
|
|
|
|
|
|
|
|
describe '#expired?' do
|
|
|
|
it 'return true when expires_at is past' do
|
|
|
|
subject.expires_at = 2.days.ago
|
|
|
|
expect(subject.expired?).to be true
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'return false when expires_at is future' do
|
|
|
|
subject.expires_at = 2.days.from_now
|
|
|
|
expect(subject.expired?).to be false
|
|
|
|
end
|
|
|
|
end
|
2016-11-28 13:36:47 +01:00
|
|
|
end
|