Javi Martín
6278175f57
Update legislation drafts translatable fields
...
Updating it required reorganizing the form so translatable fields are
together.
We also needed to add a `hint` option to the form label and input
methods so the hint wouldn't show up for every language.
Finally, the markdown editor needed to use the same globalize attributes
as inputs, labels and hints, which adds a bit of duplication.
2018-10-22 15:44:14 +02:00
Javi Martín
96b3a37222
Disable removed translations
...
After removing a translation while editing another one with invalid data
and sending the form, we were displaying the removed translation to the
user.
We now remove that translation from the form, but we don't remove it
from the database until the form has been sent without errors.
2018-10-22 15:43:28 +02:00
Javi Martín
7deb857357
Don't disable new invalid translations
...
After adding a new translation with invalid data and sending the form,
we were disabling the new translation when displaying the form again to
the user, which was confusing.
2018-10-22 15:43:28 +02:00
Javi Martín
1d2979cd57
Keep invalid translation params through requests
...
We were reloading the values from the database and ignoring the
parameters sent by the browser.
2018-10-22 15:43:28 +02:00
Javi Martín
71601bd3f8
Validate translations in banners
...
This change forces us to use nested attributes for translations, instead
of using the more convenient `:"title_#{locale}"` methods.
On the other hand, we can use Rails' native `_destroy` attribute to
remove existing translations, so we don't have to use our custom
`delete_translations`, which was a bit buggy since it didn't consider
failed updates.
2018-10-22 15:43:28 +02:00
Javier Martín
5f8311845b
Merge pull request #2967 from consul/backport-1609-fix_skip_flaky_specs
...
Fix flaky spec: Admin feature flags Enable a disabled feature
2018-10-11 17:46:59 +02:00
Javi Martín
5ae7a5512d
Skip spec before doing any requests
...
Skipping a spec in the middle of it, particularly after doing some
requests, caused Capybara to keep using the same driver in the following
spec.
Since the current spec uses the JavaScript driver, the next test would
also use the JavaScript driver, causing apparently random failures if
that test was supposed to use the Rack driver.
2018-10-11 17:14:53 +02:00
voodoorai2000
6f978b9f4e
Fix portuguese specs
2018-10-09 18:32:59 +02:00
Javi Martín
5bb5cfa7fb
Make Widget::Card translatable
2018-09-26 16:09:09 +02:00
Raimond Garcia
4086220ebf
Merge pull request #2914 from microweb10/make_polls_translatable
...
Make polls translatable
2018-09-26 13:19:17 +02:00
Julian Herrero
df9955e0c6
make use of the new spec helper it_behaves_like translatable
2018-09-21 20:52:35 +02:00
Marko Lovic
64d72ca8e7
Enable JS in shared translatable test
...
Due to its markdown editor, the admin draft version page
requires JS to correctly render the draft version form.
2018-09-19 14:54:24 +02:00
Marko Lovic
f6749049c9
Make Admin Notifications translatable
2018-09-19 12:15:26 +02:00
Javi Martín
0552616764
Use have_field to detect text input contents
...
Using `have_content` detected textareas, but not text input contents.
All credit to Marko (mlovic) for finding the issue and suggesting the
implemented solution.
2018-09-17 20:34:43 +02:00
Javi Martín
612fdb09dd
Share translatable specs
2018-09-17 20:34:43 +02:00
Javi Martín
726110c91e
Share Globalize JavaScript interface specs
2018-09-17 20:34:20 +02:00
Angel Perez
7b95f4c320
Correct typos on nested documentable/imageable
2018-09-10 11:45:48 -04:00
Angel Perez
bdda397bf1
Use new RSpec stub syntax to fix deprecation warnings
2018-09-10 11:41:20 -04:00
iagirre
271c1595ba
Changed the way the notifications page is accessed. Instead of doing it through UI, after the notifications are created the test goes directly to the notifications page (after login in the user). To check if the notification icon is correctly shown, a new test has been created that only does that.
2018-06-26 17:35:42 +02: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
0fce8ca787
Fix incorrect assertion for nested imageable example
...
The example tests if a certain selector is hidden after adding
one image but the assertion expected said selector to be visible,
which made the scenario to fail at random
2018-03-27 14:47:51 -04: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
Bertocq
fbfabaeda4
Fix typo at followable shared spec
2018-02-19 11:07:59 +01:00
Bertocq
44aeb7528d
Fix line lenght issues on spec files
2018-02-15 23:21:03 +01:00
BertoCQ
e1d6d4a8f8
Merge pull request #2416 from wairbut-m2c/show_error_message_when_relating_content_to_itself
...
Show error message when relating content to itself
2018-02-05 12:45:56 +01:00
Vicente Mendoza
295facccb1
Test to check that returns error when it comes to relate an investment content with itself.
2018-02-02 10:57:09 +01:00
Angel Perez
88a5e8b1d2
Spec: Admins/users can destroy only their authored documentables/imageables ( #2375 )
2018-01-26 09:10:58 -04:00
Bertocq
62d7d08a10
Remove no longer valid scenarios: image&doc removal by admin
2018-01-24 21:50:13 +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
María Checa
b2054ac531
Improved relationable tests for budget investments
2018-01-12 18:26:37 +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
Bertocq
2d355ce938
Enable RSpec/LetSetup cop & fix issues
...
Read more about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
2018-01-07 16:23:49 +01:00
Bertocq
1441de5107
Enable RSpec/HookArgument cop and fix issues
...
To be consistent about before/after arguments, as `:each` or `:example`
are same and default scopes, best not to send an argument in those
scenarios.
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
2018-01-07 02:07:19 +01:00
Bertocq
ed16a78f42
Enables RSpec/ExampleWording and fixes all issues
...
Both avoiding 'should' and repiting 'it' on the tests description
improves reading them and also makes all descriptions consistent.
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
2018-01-07 01:03:45 +01:00
Bertocq
d3719f0b42
Merge branch 'fix/documentable_multiple_docs'
2018-01-03 18:03:20 +01:00
Bertocq
3bf8948b11
Fix typo, dowload to download
2018-01-03 17:38:44 +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
4885acb7ac
Merge pull request #2225 from consul/chore/refactor_documents_document_partials
...
Refactor documents and document view partials
2018-01-03 17:38:16 +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
d7d1a85fbb
Refactor documents and document view partials
2018-01-02 13:32:42 +01:00
rgarcia
96066aee44
Validates map presence only on create
...
As we are using an attr_accessor to make sure a user accepts that the
proposal “has no map”, the validation was being run in every save.
Making other things break, for example the updating of the counter
cache `cached_votes_up`, when someone voted for the proposal, as the
attr_accessor `skip_map` was not present
2017-12-26 12:39:29 +01:00
Bertocq
f6d23df862
Avoid using eval when send can do the job
2017-12-25 23:47:55 +01:00
Bertocq
2283237d44
Avoid Looking up factories by class is deprecated and will be removed in FactoryGirl 5.0
2017-12-25 23:46:51 +01:00