Commit Graph

12 Commits

Author SHA1 Message Date
Javi Martín
9aa07e3b74 Follow naming conventions for HTML classes and IDs
We use underscores for IDs and hyphens for classes.
2018-11-05 18:20:50 +01:00
Javi Martín
b024363fae Fix removing an option for legislation questions
We were allowing the `_destroy` field for translations, but not for the
options themselves.
2018-11-05 18:20:50 +01:00
Javi Martín
3165b9b9f4 Fix legislation options not being updated
We broke this behaviour by introducing translations and not allowing the
`id` parameter anymore.
2018-11-05 18:20:50 +01:00
Javi Martín
015cdcc557 Simplify creating a process in questions specs 2018-11-05 18:20:50 +01:00
Javi Martín
2658bb55f6 Wrap translation fields in a div
This way we can show/hide that div when displaying translations, and we
can remove the duplication applying the same logic to the label, the
input, the error and the CKEditor.

This way we also solve the problem of the textarea of the CKEditor
taking space when we switch locales, as well as CKEditor itself taking
space even when not displayed.
2018-11-05 18:20:50 +01:00
Javi Martín
7cd06bd51d Update legislation questions translatable fields 2018-11-05 18:20:25 +01:00
Javi Martín
5e95339e51 Fix flaky legislation question spec
The test was failing sometimes because of the sequence:

within('#side_menu') do
  click_link "Collaborative Legislation"
end

click_link "All"
expect(page).to have_content 'An example legislation process'
click_link 'An example legislation process'

Right after clicking the "Collaborative Legislation" link, the link 'An
example legislation process' is already available. So sometimes Capybara
might click the links "All" and 'An example legislation process' at more
or less the same time, causing the second link not to be correctly
clicked.

Making sure the "All" link doesn't exist anymore we guarantee Capybara
will wait for the previous AJAX request to finish before clicking the
next link.

Note the test to "Create Valid legislation question" is almost identical
but it doesn't fail because it doesn't use Capybara's JavaScript driver.
2018-11-05 18:19:50 +01:00
Marko Lovic
06347062dd Make Legislation Questions translatable 2018-09-19 14:54:24 +02: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
rgarcia
a7ce8d5c70 fixes flaky spec
Reactivates feature setting after spec
2017-09-19 15:14:28 +02:00
Amaia Castro
98b6dd75ea Fix stack level too deep bug when deleting questions with answers 2017-01-02 20:45:20 +01:00
Amaia Castro
d25d6c178c Legislation Questions model and basic admin 2016-12-20 18:52:43 +01:00