Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for users with no payment history #450

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion spec/features/payments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down