Commit Graph

19 Commits

Author SHA1 Message Date
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
decabeza
6b85ed8747 Add show and collapse text on comments tree 2019-05-31 11:40:57 +02:00
decabeza
0154bc556d Add link to comment path on comment date 2019-05-31 11:40:53 +02:00
Javi Martín
dbcc5fb724 Use AR relations when merging comments
Using arrays made it difficult to order by more than one field (like the
`most_voted` scope does), and so we were ordering by `confidence_score`
and ignoring the `created_at` column.

Using an AR relation makes it easy to reuse the existing `most_voted`
scope.

This change has one side effect: now comments with equal votes are
ordered in descending order instead of having no specific order. That
means flaky specs which failed sometimes because they assumed comments
were ordered by date are now always green.

I've also re-added the `oldest` scope removed in 792b15b thinking it was
removed because using it with arrays was too hard.
2019-05-29 20:50:53 +02:00
Javi Martín
307cf24846 Use describe on feature tests
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.

Because of this change, we also need to change `background` to `before`
or else these tests will fail.
2019-05-28 16:36:54 +02:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Angel Perez
4ddc869441 Mitigate recurrent flaky specs for voting comments 2018-07-13 22:42:41 +02:00
Angel Perez
92af93e8bd Fix failing tests that simulated a click against the DOM
The now-deprecated `.trigger('click')` API simulated a click against
the DOM rather a click on the UI, which made our tests fragile and
wouldn't simulate actual user interaction
2018-03-27 14:47:51 -04:00
Angel Perez
b3ce674ffc Enable previously disabled test scenarios 2018-03-27 14:47:50 -04:00
Angel Perez
38af45d450 Replace deprecated .trigger('click') API with .click 2018-03-27 14:47:49 -04:00
Raúl Fuentes
dbf4ec9716 changed test, fixed variable instead os us the let option 2018-02-08 16:36:35 +01:00
Bertocq
34bb9d65b1 Enable RSpec/NotToNot cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
2018-01-07 17:39:48 +01:00
iagirre
2621d2694b Added test for comments 2017-09-13 16:04:45 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Bertocq
c9bc028524 Remove all unnecesary extra spacing and Layout/ExtraSpacing list from rubocop file 2017-06-28 14:12:51 +02:00
Bertocq
f6fe9cc7d2 Fix all Layout/SpaceAroundOperators rubocop issues and remove file list from rubocop_todo list 2017-06-26 18:04:20 +02:00
rgarcia
792b15b224 Merges annotations 2017-06-07 14:58:34 +02:00
Amaia Castro
f43f13e826 Create first comment automatically from the annotation 2017-01-09 17:03:00 +01:00
Amaia Castro
b8f034d896 Legislation annotations/comments page 2017-01-09 09:29:15 +01:00