2023-02-14 13:10:58 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-19 18:16:54 +02:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class StatisticProfilePrepaidPackTest < ActiveSupport::TestCase
|
2023-03-08 17:08:12 +01:00
|
|
|
test 'prepaid pack have a expries date' do
|
2022-10-19 18:16:54 +02:00
|
|
|
prepaid_pack = PrepaidPack.first
|
|
|
|
user = User.find_by(username: 'jdupond')
|
|
|
|
p = StatisticProfilePrepaidPack.create!(prepaid_pack: prepaid_pack, statistic_profile: user.statistic_profile)
|
2023-02-14 13:10:58 +01:00
|
|
|
expires_at = 12.months.from_now
|
2022-10-19 18:16:54 +02:00
|
|
|
assert p.expires_at.strftime('%Y-%m-%d'), expires_at.strftime('%Y-%m-%d')
|
|
|
|
end
|
|
|
|
end
|