Skip to content

Commit

Permalink
feat(:capibara tests) fixup! fixup! fixup! add tests for contorollers…
Browse files Browse the repository at this point in the history
… that render the templates
  • Loading branch information
VladislavSokov committed Sep 29, 2023
1 parent 6bb0972 commit db9ee9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/features/my_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
expect(page).to have_http_status(:success)
expect(page).to have_button('Add account')
accounts_block = find('.card.box.accounts')
expect(accounts_block).to have_content(child.name)
expect(accounts_block).to have_link(child.name, href: account_path(child))
expect(accounts_block).to have_content('Balance')
expect(accounts_block).to have_content(child.balance)
expect(accounts_block).to have_link(nil, href: new_account_topup_path(child))
Expand All @@ -31,7 +31,8 @@
expect(page).to have_content('Shared accounts')

shared_accounts_block = find('.card.box.shared-accounts')
expect(shared_accounts_block).to have_content(accepted_share.account.name)
expect(shared_accounts_block).to have_content("Owner: #{accepted_share.account.parent.email}")
expect(shared_accounts_block).to have_link(accepted_share.account.name, href: account_path(accepted_share.account))
expect(shared_accounts_block).to have_content('Balance')
expect(shared_accounts_block).to have_content(accepted_share.account.balance)
expect(shared_accounts_block).to have_link(nil, href: new_account_topup_path(accepted_share.account))
Expand All @@ -44,6 +45,7 @@
expect(unaccepted_shares_block).to have_content(unaccepted_share.account.name)
expect(unaccepted_shares_block).to have_content(unaccepted_share.account.parent.email)
expect(unaccepted_shares_block).to have_content(unaccepted_share.created_at.to_formatted_s(:short))
expect(unaccepted_shares_block).to have_link('accept', href: accept_account_share_url(token: unaccepted_share.token))
expect(unaccepted_shares_block).
to have_link('accept', href: accept_account_share_url(token: unaccepted_share.token))
end
end

0 comments on commit db9ee9d

Please sign in to comment.