Commit Graph

56 Commits

Author SHA1 Message Date
Javi Martín
2cdc6a1b1b Check CKEditor is filled properly in tests
It looks like sometimes, particularly when the first thing we do after
loading a page is filling the CKEditor fields and submitting the form,
CKEditor doesn't have enough time to format the text, and so it's sent
as plain text instead of HTML. This behaviour can be reproduced on my
local machine after upgrading to Rails 5.1, with the test "Admin Active
polls Add" failing 100% of the time.

Checking CKEditor has been filled in correctly solves the issue.
2020-04-10 17:11:56 +02:00
Javi Martín
849c081a1b Simplify the way we attach documents in tests
Now we do it the same way we attach images in `nested_imageable`.

Now we don't need to execute some JavaScript in the test, which by the
way was causing an error when upgrading to jQuery 3.
2019-11-07 15:58:49 +01:00
Javi Martín
d015362299 Remove obsolete poltergeist code
We moved to chromedriver a long time ago.
2019-11-07 15:58:49 +01:00
Javi Martín
8e3bfa0d72 Apply Style/RedundantReturn rubocop rule
We were already following this pattern most of the time.
2019-10-26 13:26:35 +02:00
Javi Martín
57ef380379 Add and apply Layout/ExtraSpacing rubocop rule 2019-10-24 18:11:58 +02:00
Javi Martín
d938077813 Remove empty lines around if and when body
Unfortunately, there doesn't seem to be a Rubocop rule for this one.
I've found these empty lines thanks to Rufo.
2019-10-24 17:56:03 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
5cbd160f11 Move login_as after creating data for a test
It doesn't really affect the tests, but it helps isolate useless
assignments, and we already did it this way 94% of the time.
2019-09-25 12:43:44 +02:00
Javi Martín
da121ebc53 Remove redundant setting resets in after blocks
Settings are stored in the database, and so any changes to the settings
done during the tests are automatically rolled back between one test and
the next one.

There were also a few places where we weren't using an `after` block but
changing the setting at the end of the test.
2019-09-23 13:47:45 +02:00
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
Senén Rodero Rodríguez
5eb5f02cbe Fix budget investment specs
After adding investment translatable fields to forms, they will be
generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:20:24 +02:00
Senén Rodero Rodríguez
78c2f54c5d Fix proposal specs
After adding proposal translatable fields to forms, they will be generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:19:36 +02:00
decabeza
f40787561d Remove all references to question and external_url fields 2019-04-30 16:42:07 +02:00
decabeza
07fd5084f7 Show request to admins and short description only for resources 2019-04-24 14:01:04 +02:00
decabeza
f47ec9d7dc Fix hound warnings 2019-03-26 18:21:19 +01:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
taitus
a4673c8b3e Add shared nested_documentable specs to admin dashboard actions specs.
Not render Documents count on dashboard actions views.
Add skips on nested_documentable when factory_name is equal to dashboard_actions.
2019-02-02 15:30:35 +01:00
Angel Perez
7b95f4c320 Correct typos on nested documentable/imageable 2018-09-10 11:45:48 -04:00
Bertocq
21ead40e26 Disable document upload & show with new setting
When Setting allow_attached_documents is disabled (false value) the user
should not be able to upload documents neither see the documents lists
2018-04-10 13:10:14 +02:00
rgarcia
59805e9b73 Fix specs 2018-04-05 22:16:36 +02:00
Raimond Garcia
1692abc54a Merge pull request #2374 from wairbut-m2c/upload_documents_feature
Upload documents feature
2018-04-05 19:39:12 +02:00
Angel Perez
ceb38739c7 Use absolute paths for fixtures 2018-03-27 14:47:49 -04:00
decabeza
53e36850a4 Fixes documentable rubocop offences 2018-02-28 16:21:22 +01:00
decabeza
e79f64c009 Updates specs 2018-02-28 16:21:18 +01:00
Vicente Mendoza
c3327a5da0 rebase and fix test to attach max number of files 2018-01-24 16:55:39 +01:00
Vicente Mendoza
410caced3e test added for changes at documentable's view 2018-01-24 12:48:06 +01:00
Bertocq
1246bd4e62 Fix poltergeist input focus issues 2018-01-03 17:38:44 +01:00
Bertocq
e71340bccb Bring back max doc attachment scenario, using all pdf fixtures 2018-01-03 17:38:44 +01:00
Bertocq
5bf16eb1ac Remove index param from attach new file helper test function 2018-01-03 17:38:44 +01:00
Bertocq
2f7e81e5ca Remove unused documentable_factory_name argument from documentable_attach_new_file helper method 2018-01-02 13:59:58 +01:00
Bertocq
ce0a7f6fad Rubocop autocorrections 2017-10-17 22:00:00 +02:00
rgarcia
23682fadd8 fixes document specs 2017-10-06 17:50:41 +02:00
decabeza
dd69401477 Merge branch 'master' into question-answer-documents 2017-10-06 15:18:42 +02:00
decabeza
b4d494ce24 fixes documents specs 2017-10-06 12:57:21 +02:00
iagirre
b31abb64d7 Removed the methods not used from nested_documentable specs (the ones that were deleted in the questions specs) and removed also the document params from questions_params (not used anymore). 2017-10-05 17:28:24 +02:00
María Checa
8dc05d399b Fixed tests 2017-10-04 10:03:44 +02:00
Senén Rodero Rodríguez
1a8fda9352 Fix broken specs 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
ce29185b76 Fix documentable on admin poll questions. Adapt nested documentable shared specs to admin fetaure specs and include at admin poll questions specs. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
f8d78ec4ab Remove new_nested action from images controller. Use cocoon gem to manage new nested fields creation on images. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
88a7a29d27 Remove new_nested action from documents controller. Use cocoon gem to manage new nested fields creation on documents. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
baf9ce90a9 Obfuscate documentable and imageable file names. 2017-09-26 13:56:06 +02:00
Senén Rodero Rodríguez
966ff4dc03 User new direct uploads controllers action on imageable. 2017-09-26 13:56:06 +02:00
Senén Rodero Rodríguez
824dd26d5a User new direct uploads controllers action on documentable. Skipped spec. 2017-09-26 13:55:51 +02:00
Senén Rodero Rodríguez
52f35c0360 Remove sleep from nested documentable shared feature specs. Use matchers able to wait new content to appear. 2017-09-26 13:55:03 +02:00
Senén Rodero Rodríguez
3310089208 Add nested imageable shared spec to check nested images behavior at imageable any recipients. 2017-09-26 13:55:03 +02:00
BertoCQ
5cf862064d Merge pull request #1888 from consul/flaky-specs
Fixes some flaky specs
2017-09-19 16:43:41 +02:00
rgarcia
3b76c7428b fixes flaky spec
Adds random number to the proposal’s title, to avoid js popup
displaying similar proposals
2017-09-19 15:14:29 +02:00
Bertocq
e4e78c8f16 Rubocop autocorrections 2017-09-14 15:08:35 +02:00
Senén Rodero Rodríguez
796e6f9ce1 Code adaptation to work with nested documents and plain documents. 2017-08-25 18:34:55 +02:00