The code powering m.abunchtell.com https://m.abunchtell.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

20 rindas
501 B

  1. require 'rails_helper'
  2. RSpec.describe Subscription, type: :model do
  3. let(:alice) { Fabricate(:account, username: 'alice') }
  4. subject { Fabricate(:subscription, account: alice) }
  5. describe '#expired?' do
  6. it 'return true when expires_at is past' do
  7. subject.expires_at = 2.days.ago
  8. expect(subject.expired?).to be true
  9. end
  10. it 'return false when expires_at is future' do
  11. subject.expires_at = 2.days.from_now
  12. expect(subject.expired?).to be false
  13. end
  14. end
  15. end