Commit Graph

10 Commits

Author SHA1 Message Date
Javi Martín
dd7d6440ec Add and apply Capybara/VisibilityMatcher rule
This rule was added in rubocop-rspec 1.39.0. The `visible: false` option
is equivalent to `visible: :all`, but we generally use it meaning
`visible: :hidden` for positive expectations and `visible: :all` for
negative expectations.

The only exceptations are tests where we count the number of map icons
present. I'm assuming in this case we care about the number of map icons
independently on whether they are currently shown in the map, so I'm
keeping the `visible: :all` behavior in this case.
2020-10-25 14:23:53 +01:00
Senén Rodero Rodríguez
b2196561e2 Override proposal sticky top property when anchored
It's known that Foundation Sticky causes some renderization problems
when rendering sticky elements in anchored position.

The problem seems to be that Foundation Sticky is showing the
support box on medium and up devices overlapped with "Share" and
"Community" sidebar boxes when loading proposal page through
Turbolinks and when restoring the page from brwoser history.
Foundation seems to be doing some top property dynamic calculation
(javascript) and is setting top property to `206px` when it should be
`0px`. Notice that this do not happen on page first load (without
Turbolinks). Check foundation/foundation-sites issue 11098.

Another workaround could be to remove sticky feature for bigger that
small devices (medium large xlarge xxlarge).
Check foundation/foundation-sites issue 9892.
2020-08-24 19:41:14 +02:00
Senén Rodero Rodríguez
137e0f5a64 Remove description for screen readers
It was being duplicated when restoring a page by using browser
history. With this solution we will avoid to have screen readers
descriptions more than once inside any sociual share button.
2020-08-12 10:07:35 +02:00
Javi Martín
7b96180a76 Upgrade Turbolinks to version 5.2.1
We didn't upgrade Turbolinks when we upgraded to Rails 5 so we didn't
upgrade too many things at the same time, and postponed it... until now
:).

Note upgrading Turbolinks fixes an issue with foundation's sticky when
using the browser's back and forward buttons. We're adding tests for
these scenarios.

Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
2020-08-05 14:10:22 +02:00
Javi Martín
983bf49b38 Simplify code related to Foundation's sticky
In the past we had huge problems trying to make it work with Turbolinks.
However, after updating foundation-rails in commit 58071fd6, these hacks
aren't necessary anymore.

We're adding a test for the scenario of visiting a page using
Turbolinks, which was missing, so we're sure we aren't breaking
anything.

Note the sticky will still not work after using the browser back button.
We haven't been able to make it work with turbolinks-classic; we'll fix
this issue when upgrading turbolinks.
2020-08-05 11:34:57 +02:00
decabeza
e3539544a8 Remove google plus share button 2020-07-17 16:24:20 +02:00
Javi Martín
d9eeb1ad15 Improve test checking order by relevance
The test wasn't working when postgres used the English dictionary
because in English the word "what" was ignored (or, at least, not given
enough relevance) while searching. When we wrote the test, it passed
because back then we always used the Spanish dictionary. However, when
we switched to a dictionary based on the default locale (in commit
d99875cd), we had to force this test to keep using the Spanish
dictionary.

Using the Spanish dictionary in a test where all texts are in English is
strange to say the least ;). So here we're making the test a bit easier
to understand.

Since now we're only using the `:spanish_search` tag in one test, I've
decided to remove it and simply add it to that test's setup.
2020-07-14 14:49:39 +02:00
Javi Martín
91da038b27 Extract shared tests to flag/unflag a record 2020-07-07 22:56:17 +02:00
Javi Martín
7563b7f4d1 Simplify polymorphic routes in shared specs
Now we get rid of the "hierarchy" methods and use standard Rails methods
except in the routes definitions themselves.
2020-06-15 11:54:05 +02: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