mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
I couldn't fix it easily. But I also think that the testing approach had
low value here.
It raised:
```
Failures:
1) Map map can load does not show alert
Failure/Error:
assert_raises(Capybara::ModalNotFound) do
accept_alert { visit '/map' }
end
Minitest::Assertion:
Capybara::ModalNotFound expected but nothing was raised.
[Screenshot Image]: /home/runner/work/openfoodnetwork/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_map_map_can_load_does_not_show_alert_64.png
# ./spec/system/consumer/map_spec.rb:11:in `block (3 levels) in <top (required)>'
# ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <top (required)>'
# ./spec/base_spec_helper.rb:153:in `block (3 levels) in <main>'
# ./spec/base_spec_helper.rb:153:in `block (2 levels) in <main>'
```
16 lines
360 B
Ruby
16 lines
360 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'system_helper'
|
|
|
|
RSpec.describe 'Map' do
|
|
context 'map cannot load' do
|
|
it 'shows alert' do
|
|
message = accept_alert { visit '/map' }
|
|
expect(message).to eq(
|
|
"Unable to load map. Please check your browser " \
|
|
"settings and allow 3rd party cookies for this website."
|
|
)
|
|
end
|
|
end
|
|
end
|