Created
May 8, 2018 09:22
-
-
Save stevo/6957ac2a0885b15691f62fc561cf954c to your computer and use it in GitHub Desktop.
An opinionated guide to readable RSpec (part 2 of 2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'returns accounts expired in last week' do | |
create(:account, expiry_date: 1.day.from_now) | |
create(:account, expiry_date: Date.current) | |
account_1 = create(:account, expiry_date: 1.day.ago) | |
account_2 = create(:account, expiry_date: 7.days.ago) | |
create(:account, expiry_date: 8.days.ago) | |
result = RecentlyExpiredAccountsQuery.call | |
expect(result).to match_array([account_1, account_2]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment