Commit Graph

12 Commits

Author SHA1 Message Date
taitus
4e9d5d8c5a Allow sorting widget_cards on custom pages 2024-03-21 18:27:49 +01:00
Javi Martín
0cec581ec0 Add and apply Capybara/RSpec/HaveSelector rule
This rule was added in rubocop-capybara 2.19.0. We were following it
about 85% of the time.

Now we won't have to check both have_css and have_selector when
searching the code.
2023-11-08 14:18:16 +01:00
taitus
c2f03f869a Add new footer content block
Include a new content block called 'footer_legal' for additional legal footer items.
2023-09-26 17:43:20 +02:00
Javi Martín
629e208e9d Add and apply ArgumentAlignment rubocop rule
We're choosing the default `with_first_argument` style because it's the
one we use the most.
2023-08-18 14:56:16 +02:00
decabeza
10cd182774 Add more images to admin site customization 2022-08-17 13:51:13 +02:00
Javi Martín
dac6c714cf Use "help with" instead of "help about"
As suggested by Pomerange; the "help about" construction indeed sounds a
bit strange.
2022-06-01 14:27:33 +02:00
Javi Martín
92ddcb7aef Use JavaScript in system tests by default
JavaScript is used by about 98% of web users, so by testing without it
enabled, we're only testing that the application works for a very
reduced number of users.

We proceeded this way in the past because CONSUL started using Rails 4.2
and truncating the database between JavaScript tests with database
cleaner, which made these tests terribly slow.

When we upgraded to Rails 5.1 and introduced system tests, we started
using database transactions in JavaScript tests, making these tests much
faster. So now we can use JavaScript tests everywhere without critically
slowing down our test suite.
2021-04-07 14:41:06 +02:00
Javi Martín
9cfcbf2f3b Use visible texts in tests
Content like lowercase letters with `text-transform: uppercase` or
spaces after elements with `display: block` or "You're on page:" are not
seen that way by users with a browser supporting CSS.

So we're testing what most users actually experience.
2021-04-07 14:41:06 +02:00
Javi Martín
81295abd8c Move custom page 404 test to controller specs
So it's similar to the other custom page 404 tests.

Note we're explicitely marking the page as a draft so it's more obvious
what's going on in the test.
2021-03-31 14:42:20 +02:00
Javi Martín
ee29ca43a5 Make widget cards polymorphic
So now we'll be able to add them to other sections.

We're also adding a `dependent: :destroy` relation to models having
cards since it doesn't make sense to have cards around when their page
has been destroyed.
2021-01-14 17:37:58 +01:00
Javi Martín
3da4ee00b8 Simplify tests requiring admin login
We were repeating the same code over and over (with a few variants) to
setup tests which require an administrator. We can use a tag and
simplify the code.
2020-12-02 15:33:19 +01:00
Javi Martín
9427f01442 Use system specs instead of feature specs
We get rid of database cleaner, and JavaScript tests are faster because
between tests we now rollback transactions instead of truncating the
database.
2020-04-24 15:43:54 +02:00