1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/models/account_role_spec.rb

56 lines
1.6 KiB
Ruby
Raw Normal View History

2019-02-01 22:48:23 -05:00
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe AccountRole do
2019-02-01 23:35:08 -05:00
pending '.active'
2019-02-08 01:42:32 -05:00
pending '.not_deleted'
pending '.not_expired'
2019-02-01 23:42:35 -05:00
2019-07-20 06:07:02 -04:00
describe '#account' do
it { is_expected.to belong_to :account }
end
describe '#role' do
it { is_expected.to belong_to :role }
end
2019-02-01 23:42:35 -05:00
describe '#deleted_at' do
def allow_value(*)
super.for :deleted_at
end
it { is_expected.to allow_value nil }
2019-02-08 01:42:32 -05:00
it { is_expected.to allow_value Time.zone.now }
2019-02-01 23:42:35 -05:00
it { is_expected.to allow_value Faker::Time.backward.utc }
it { is_expected.to allow_value 1.minute.ago }
it { is_expected.to allow_value 1.hour.ago }
it { is_expected.to allow_value 1.day.ago }
it { is_expected.not_to allow_value Faker::Time.forward.utc + 1.minute }
it { is_expected.not_to allow_value 1.minute.from_now }
it { is_expected.not_to allow_value 1.hour.from_now }
it { is_expected.not_to allow_value 1.day.from_now }
end
2019-02-08 01:42:32 -05:00
describe '#expires_at' do
def allow_value(*)
super.for :expires_at
end
it { is_expected.to allow_value nil }
it { is_expected.to allow_value Time.zone.now }
it { is_expected.to allow_value Faker::Time.backward.utc }
it { is_expected.to allow_value 1.second.ago }
it { is_expected.to allow_value 1.hour.ago }
it { is_expected.to allow_value 1.day.ago }
it { is_expected.to allow_value Faker::Time.forward.utc + 1.minute }
it { is_expected.to allow_value 1.minute.from_now }
it { is_expected.to allow_value 1.hour.from_now }
it { is_expected.to allow_value 1.day.from_now }
end
2019-02-01 22:48:23 -05:00
end