Commit Graph

2164 Commits

Author SHA1 Message Date
decabeza
d07a8712bf Remove duplicated spec
Same spec on line 115
2019-03-19 18:25:48 +01:00
decabeza
3f1d3f3443 Fix hound warnings 2019-03-19 18:24:49 +01:00
Alberto
7b2258aeb0 Merge pull request #3263 from Platoniq/dashboard-recommended-actions-page
Dashboard recommended actions page
2019-03-19 16:21:28 +01:00
Alberto
501f6257bf Merge pull request #3260 from Platoniq/dashboard-actions-for-published-proposals
Dashboard actions for published proposals
2019-03-19 16:20:47 +01:00
Raimond Garcia
117b7c848d Merge pull request #3257 from Platoniq/dashboard-actions-attachments
Dashboard actions attachments
2019-02-28 13:33:38 +01:00
taitus
9fac661f0c Create scope by_proposal
Add to active_for class method and to active_resources controller method the new scope by_proposal.
 - Published proposal: display all actions.
 - Draft proposal: only display actions for draft proposals.
2019-02-10 00:18:50 +01:00
Alessandro Cuoghi
2e9973cd4a Add new texts
- Changed texts
- Fixed Spec
2019-02-04 16:20:44 +01:00
taitus
487c485fe0 Add new section on sidebar menu for recommended proposals
- Display recommended_proposals on new section as goals with toogle.
- Divide recommended actions into actions done and actions pending to clarify the information to the user as summary_recomended_actions.
2019-02-04 11:48:47 +01:00
taitus
45afbc0b10 New summary for recommended actions section on progress page
- Divide recommended actions into actions done and actions pending.
- Display recomended actions as goals (diplay four by defalut) without toggle but with link to new recommended actions page.
- Display description over short_description
2019-02-04 11:39:04 +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
taitus
aa908d8d60 Add progress tab as initial page on Dashboard. 2019-02-02 14:49:28 +01:00
decabeza
546105d989 Merge branch 'master' into dashboard-master 2018-10-19 01:48:37 +02:00
Alberto
3878946c9e Merge pull request #2823 from consul/remove-guides
Removes guide feature
2018-10-18 13:19:33 +02:00
decabeza
4db54092e6 Removes unrelated dashboard changes 2018-10-18 01:26:07 +02:00
Javier Martín
e117218d68 Merge pull request #2977 from consul/backport-reenable_ckeditor_images
Bring back CKEditor images button
2018-10-17 20:21:18 +02:00
Javi Martín
6f96265a0b Bring back CKEditor images button
It was accidentally deleted in commit 914bfa6.

Note the following spec passes on my machine if we add a `sleep 0.1`
call in the `:wait_readable` part of ruby's `Net::Protocol#rbuf_fill`.
Otherwise, it hangs forever after clicking the `.fileupload-file` div,
which closes its window. It might be solved when upgrading rails,
capybara, selenium or chromedriver.

scenario "Allows images in CKEditor", :js do
  visit edit_admin_site_customization_page_path(custom_page)

  within(".ckeditor") do
    within_frame(0) { expect(page).not_to have_css("img") }

    expect(page).to have_css(".cke_toolbar .cke_button__image_icon")
    find(".cke_toolbar .cke_button__image_icon").click
  end

  within_window(window_opened_by { click_link "Browse Server" }) do
    attach_file :file,
                Rails.root.join('spec/fixtures/files/clippy.jpg'),
                visible: false
    find(".fileupload-file").click
  end

  click_link "OK"

  within(".ckeditor") do
    within_frame(0) { expect(page).to have_css("img") }
  end
end
2018-10-17 19:39:37 +02:00
Javi Martín
893f29a27a 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-10-17 15:54:59 +02:00
decabeza
dbf41421ed Removes guide feature 2018-10-17 14:58:29 +02:00
decabeza
2dae197eaa Updates i18n 2018-10-11 17:54:03 +02:00
Raimond Garcia
710e5ae965 Merge pull request #2949 from consul/i18n-language-names
Display language name or language key
2018-10-10 11:45:04 +02:00
voodoorai2000
59b35156b1 Fix flaky spec
`I18n.available_locales=` does a little magic[1] and was causing some flakieness along the way, as the `:wl` locale persisted in future specs

Thanks for the heads up @javierm 👌

[1] https://www.rubydoc.info/github/svenfuchs/i18n/I18n%2FConfig:available_locales=
2018-10-09 22:15:05 +02:00
voodoorai2000
6f978b9f4e Fix portuguese specs 2018-10-09 18:32:59 +02:00
decabeza
4ea1f7732b Updates i18n on specs 2018-10-08 11:26:53 +02:00
decabeza
b7c3a918e3 Updates js class name and id name 2018-10-05 18:18:42 +02:00
voodoorai2000
9d7042c5ae Adds missing language name translations 2018-10-05 18:08:47 +02:00
voodoorai2000
0a0261900c Display language name or language key
There where two issues with the current implementation:

- There was a possible duplication between looking up the language name in key "locale" and in key "i18n.language.name"

- The "default" option was not being picked up, as the fallback always returned the default locale's translation, "English"

With this implementation there is only a single place to put the language name: i18n.language.name. I think this place is easier to find and understand for Crowdin translators than a "locale" key hidden in general.yml

If the translation is not found we display the language key, instead of English, which makes more sense to me too 😌

Solution based on recent comments[1] on a related I18n issue

[1] https://github.com/svenfuchs/i18n/issues/365#issuecomment-419263847
2018-10-05 18:08:41 +02:00
Javier Martín
e4f99681f8 Merge pull request #2950 from consul/backport-improve_index_legislation_proposals
Allow select winner legislation proposals
2018-10-05 12:59:28 +02:00
Javi Martín
ea7d4e0996 Remove trailing whitespace 2018-10-05 12:21:37 +02:00
Javi Martín
0945f046a3 Avoid using xpath in specs
Using xpath is usually harder to read and more fragile.
2018-10-04 16:31:00 +02:00
Javi Martín
959270b0bb Separate setup, actions and expections in specs 2018-10-04 16:31:00 +02:00
Javi Martín
9c13f08c8e Show selected legislation proposals by default 2018-10-04 16:31:00 +02:00
Javi Martín
d9410a132a Always show filters for legislation proposals
As done in the rest of the application: we show the filters even if
there isn't any data to display.
2018-10-04 16:31:00 +02:00
Javi Martín
2fb5fb5fb2 Add missing newline characters 2018-10-04 16:31:00 +02:00
Javi Martín
81871a56f8 Simplify legislation process specs
We kill two birds with one stone and also make each line less than 100
characters long.
2018-10-04 16:30:59 +02:00
Javi Martín
7d69f2aaab Properly test order by ID
By default records are already ordered by ID, so we weren't checking the
ordering by ID functionality was working properly.

Making the records be ordered by title first makes the test a bit more
reliable.
2018-10-04 16:29:01 +02:00
Javi Martín
dc9cf5da55 Order by supports in descending order
Just as we do with confidence score, and as admins expect when they
order by received supports: the ones with more supports appear first.
2018-10-04 16:29:01 +02:00
Javi Martín
f1745f8040 Fix typo 2018-10-04 16:29:01 +02:00
Javi Martín
75d1ab1e52 Use AJAX requests to select legislation proposals
Now the interface is more similar to the one in budget investments.
2018-10-04 16:29:01 +02:00
Raúl Fuentes
a859de5d16 Test the selectable proposals 2018-10-04 16:29:01 +02:00
Javi Martín
ec18743251 Authorize resource after authenticating user
Just like it's done everywhere else in the application. Not doing so
means users who aren't logged in receive a "you aren't authorized"
message when they try to create a new legislation proposal instead of
being redirected to the login page.
2018-10-03 22:06:20 +02:00
María Checa
388c1a9bd9 Improved tests 2018-10-03 16:02:41 +02:00
María Checa
d73be15296 Added tests 2018-10-03 16:02:41 +02:00
Bertocq
52df63c2aa Add legislation proposal feature scenario to check random order is consistent with pagination 2018-10-03 13:46:32 +02:00
Bertocq
89b8e51a93 Add helper function to get legislation proposals list order on feature spec 2018-10-03 13:46:32 +02:00
Bertocq
d36e47c740 Add legislation proposal spec, with random list order scenario 2018-10-03 13:46:00 +02:00
Javier Martín
132fea9c94 Merge pull request #2913 from papayalabs/2741-updates-translatable-custom-pages-reloaded
Updates translatable custom pages
2018-10-03 13:23:13 +02:00
Javier Martín
2775ae2b50 Merge pull request #2924 from consul/backport-1588-make-homepage-content-translatable
Make homepage content translatable
2018-10-03 13:20:49 +02:00
Alberto
857f747ab8 Merge pull request #2922 from consul/legislation-proposals-imageable
Legislation proposals imageable
2018-10-02 11:22:19 +02:00
decabeza
7c194f6042 Adds imageable to legislation proposals 2018-10-01 16:48:46 +02:00
decabeza
dd11a040a6 Adds setting to enable or disable help page 2018-09-28 18:59:28 +02:00