From 2d8d158b6deb0692420ca68034ec8703bca16602 Mon Sep 17 00:00:00 2001 From: Camille Villa Date: Mon, 5 Aug 2019 13:33:07 -0700 Subject: [PATCH] Add a test for users with no payment history --- spec/features/payments_spec.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/spec/features/payments_spec.rb b/spec/features/payments_spec.rb index cdb3af97..bdba3ed2 100644 --- a/spec/features/payments_spec.rb +++ b/spec/features/payments_spec.rb @@ -5,12 +5,26 @@ RSpec.describe 'Payments History', type: :feature do let(:user_with_payments) { '521181' } let(:user_with_single_payment) { '521182' } + let(:user_with_no_payments) { '521206' } before do login_as(username: 'SUPER1', patron_key: user_with_payments) end - context 'when user has a single payment' do + context 'with no payments' do + before do + login_as(username: 'NOTHING', patron_key: user_with_no_payments) + end + + it 'does not load table', js: true do + visit fines_path + click_on 'Show history' + + expect(page).to have_css('span', text: 'There is no history on this account') + end + end + + context 'with a single payment' do before do login_as(username: 'SUPER2', patron_key: user_with_single_payment) end