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

HOTT-4244 Error message when the corresponding year exchange rates do not exist #1799

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

HWallenberg
Copy link
Contributor

@HWallenberg HWallenberg commented Jan 12, 2024

Jira link

https://transformuk.atlassian.net/browse/HOTT-4244

What?

I have altered:

  • Altered app/views/exchange_rates/show.html.erb with a conditional statement to check if there are any exchange rates which will display a message if not.
  • Update spec appropriately spec/views/exchange_rates/show.html.erb_spec.rb

Why?

I am doing this because:

  • User was able to enter an erroneous year into the address bar and a blank table was displayed instead of an appropriate message.

Have you? (optional)

  • Reviewed view changes with stake holders

image

jebw
jebw previously approved these changes Jan 12, 2024
jebw
jebw previously approved these changes Jan 16, 2024
Copy link
Contributor

@jebw jebw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - minor suggestion but perfectly happy without it as well

context 'when there are no exchange rates' do
let(:exchange_rate_collection) { build(:exchange_rate_collection, exchange_rates: []) }

it { is_expected.to have_css 'p', text: "There are no #{exchange_rate_collection.type} exchange rates for the year specified." }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could test that the table is not included?

it { is_expected.not_to have_css 'table' }

Copy link
Contributor

@jebw jebw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants