I think this is the more relevant wiki page for someone looking into
regenerating cassettes.
Also, no need to mention bitwarden explicitly, the wiki page already
explains everything.
This happened back in 2015 through
9c9051498b, but two places were missed.
One was a code comment so did not affect anything (other than confused
code readers I guess?). The other one did create a regression but was
later fixed by 18d966f0de in 2021.
As configured, it's meant to annotate PRs with linter errors (so you
don't have to skim through logs). So it does not make sense for pushes.
In fact, on pushes rubocop action is doing nothing, and prettier action
is failing with:
> reviewdog: this is not PullRequest build.
> sed: couldn't write 80 items to stdout: Broken pipe
Capybara helpers already wait for the content to show up (and we already
have a default of 10 seconds configured), so I don't think waiting more is
actually the problem in these specs.
But if we wanted to wait more, I think it's better to pass the `:wait`
option to capybara matchers, because that's a "maximum waiting value"
but we'll still proceed earlier if the content shows up.
Using the same idea, I changed the positive assertions to happen first,
because negative assertions do spend "max wait time" waiting, while
positive assertions only wait until the content shows up.
It's supposed to be faster and more compact, and the previous format
will become unsupported in Rails 7.2 as per Rails boot warnings:
> DEPRECATION WARNING: Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.
>
> Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
> for more information on how to upgrade.
> (called from <main> at /path/to/config/environment.rb:5)
##### Before
```
$ bin/rspec spec/system/admin/order_cycles/simple_spec.rb:460
Running via Spring preloader in process 79308
Run options: include {:locations=>{"./spec/system/admin/order_cycles/simple_spec.rb"=>[460]}}
As an administrator
I want to manage simple order cycles
as an enterprise user
that is a manager of the coordinator
when variants are hidden via inventory settings
Capybara starting Puma...
* Version 6.5.0, codename: Sky's Version
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:51103
shows a warning when going to 'outgoing products' tab
Finished in 3.95 seconds (files took 0.45949 seconds to load)
1 example, 0 failures
```
##### After
```
$ bin/rspec spec/system/admin/order_cycles/simple_spec.rb:460
Running via Spring preloader in process 79234
Run options: include {:locations=>{"./spec/system/admin/order_cycles/simple_spec.rb"=>[460]}}
As an administrator
I want to manage simple order cycles
as an enterprise user
that is a manager of the coordinator
when variants are hidden via inventory settings
shows a warning when going to 'outgoing products' tab
Finished in 4.03 seconds (files took 0.49981 seconds to load)
1 example, 0 failures
```
This is mainly to shush a lot of warnings when running the test suite,
like the following:
```
WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert"
```
We're passing the `id` key twice, and with different value, resulting in
warnings like:
> /path/to/app/views/producers/index.html.haml:27: warning: key :id is duplicated and overwritten on line 31
Use only the latest value passed to remove the warning.
##### Before
```
$ bundle exec rspec -e "displays in an iframe" -e "logging in with a redirect set"
(...)
Run options: include {:full_description=>/(?-mix:displays\ in\ an\ iframe)|(?-mix:logging\ in\ with\ a\ redirect\ set)/}
Capybara starting Puma...
* Version 6.5.0, codename: Sky's Version
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:50292
/path/to/app/views/producers/index.html.haml:27: warning: key :id is duplicated and overwritten on line 31
./path/to/app/views/groups/show.html.haml:68: warning: key :id is duplicated and overwritten on line 72
Modal window with text `Unable to load map. Please check your browser settings and allow 3rd party cookies for this website.` has been opened, but you didn't wrap your code into (`accept_prompt` | `dismiss_prompt` | `accept_confirm` | `dismiss_confirm` | `accept_alert`), accepting by default
.
Finished in 4.54 seconds (files took 4.04 seconds to load)
2 examples, 0 failures
```
##### After
```
$ bundle exec rspec -e "displays in an iframe" -e "logging in with a redirect set"
(...)
Run options: include {:full_description=>/(?-mix:displays\ in\ an\ iframe)|(?-mix:logging\ in\ with\ a\ redirect\ set)/}
Capybara starting Puma...
* Version 6.5.0, codename: Sky's Version
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:50256
.Modal window with text `Unable to load map. Please check your browser settings and allow 3rd party cookies for this website.` has been opened, but you didn't wrap your code into (`accept_prompt` | `dismiss_prompt` | `accept_confirm` | `dismiss_confirm` | `accept_alert`), accepting by default
.
Finished in 4.17 seconds (files took 4.1 seconds to load)
2 examples, 0 failures
```
2025-10-14 07:58:32 +02:00
24 changed files with 107 additions and 73 deletions
# Test Stripe API integration and record new cassettes.
# Requires account details in .env.test.local. You can copy from Bitwarden, or [set up a new Stripe account](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Setting-up-Stripe-on-an-OFN-instance)
# Requires account details in .env.test.local. See [Stripe testing](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Stripe-testing) for details
expect(page).tohave_content"Sorry, no results found for xyzzy. Try another search?"
expect(page).not_tohave_contentdistributor.name
end
it"by typing in the search field"do
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.