Commit Graph

14352 Commits

Author SHA1 Message Date
Javi Martín
7be72df5bf Remove redundant I18n resets in after blocks
We already configure `I18n.locale` and we reset Globalize's fallbacks
before every test.

On the other hand, RSpec automatically resets anything which is stub
with `allow`, so there's no need to use `and_call_original` in an
`after` block.
2019-09-23 13:47:45 +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
Javier Martín
9182c833c0 Merge pull request #3717 from rockandror/file-uploads-label-errors
Remove attachment useless code to show errors
2019-09-23 12:53:10 +02:00
Senén Rodero Rodríguez
d1af36d1be Remove uneeded lines
Rails form already add an error class when image or document attachments
has validations errors.
2019-09-23 10:51:25 +02:00
Javier Martín
608e113d03 Merge pull request #3698 from consul/share_message_interpolation
Fix share message interpolation variable
2019-09-22 03:37:30 +02:00
Javier Martín
eaa87513c9 Merge pull request #3693 from DenisNikolski/booths-search
Add search form on admin booths
2019-09-22 03:09:50 +02:00
DenisNikolski
5627c8ccf4 add test for booths search 2019-09-21 16:25:20 +03:00
Javi Martín
53670602e0 Allow managers to read investment suggestions
When creating a budget investment with an unverified manager (for
example, a manager who isn't part of the local census), there's a
request to `Budgets::InvestmentsController#suggest`. Since the manager
isn't verified, suggestions can't be obtained.

There are serveral ways to fix this problem:

* Add a `suggest` action to Management::Budgets::InvestmentsController,
doing the same thing the main `suggest` action does.
* Give unverified users permission to access investment suggestions
* Give managers permission to access investment suggestions

I've chosen the last one because I thought it was simple and only
changed existing behaviour for managers, but any other solution would be
as valid. I haven't added the `phase: "accepting"` condition to keep it
simple, since a read-only action like this one in the management portal
isn't gonna create security risks.
2019-09-20 12:51:26 +02:00
dependabot-preview[bot]
dde9caf7fd Merge pull request #3706 from consul/dependabot/bundler/rubocop-rspec-1.35.0 2019-09-19 15:03:06 +00:00
Javier Martín
27702e89a0 Merge pull request #3705 from consul/dependabot/bundler/puma-4.1.1
Bump puma from 3.12.1 to 4.1.1
2019-09-19 16:37:02 +02:00
Javi Martín
766f82a576 Apply RSpec/ExampleWording rubocop rule
This rule was improved in rubocop-rspec 1.35.0 and now it detects a case
it didn't detect in the past.
2019-09-19 16:31:23 +02:00
dependabot-preview[bot]
21634cf4fe Bump rubocop-rspec from 1.33.0 to 1.35.0
Bumps [rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec) from 1.33.0 to 1.35.0.
- [Release notes](https://github.com/rubocop-hq/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop-rspec/compare/v1.33.0...v1.35.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 16:47:42 +00:00
dependabot-preview[bot]
3786adc8ad Bump puma from 3.12.1 to 4.1.1
Bumps [puma](https://github.com/puma/puma) from 3.12.1 to 4.1.1.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v3.12.1...v4.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-16 16:46:40 +00:00
Javier Martín
3c49ae3386 Merge pull request #3496 from LextrendIT/feature/refactor_embedded_video
Refactor embed video helper to disconnect from @proposal
2019-09-14 00:02:41 +02:00
DenisNikolski
54c4a8d34b fix shifts_spec 2019-09-13 22:51:07 +03:00
Javier Martín
61b28224ae Merge pull request #3667 from consul/dependabot/bundler/paranoia-2.4.2
Bump paranoia from 2.4.1 to 2.4.2
2019-09-13 20:44:47 +02:00
dependabot-preview[bot]
32df471946 Bump paranoia from 2.4.1 to 2.4.2
Bumps [paranoia](https://github.com/rubysherpas/paranoia) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/rubysherpas/paranoia/releases)
- [Changelog](https://github.com/rubysherpas/paranoia/blob/core/CHANGELOG.md)
- [Commits](https://github.com/rubysherpas/paranoia/compare/v2.4.1...v2.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-13 17:37:28 +00:00
Javier Martín
edb51c09c2 Merge pull request #3442 from consul/dependabot/bundler/i18n-tasks-0.9.29
Bump i18n-tasks from 0.9.25 to 0.9.29
2019-09-13 19:35:37 +02:00
Javier Martín
17c91d529f Merge pull request #3001 from consul/dependabot/bundler/email_spec-2.2.0
Bump email_spec from 2.1.1 to 2.2.0
2019-09-13 19:30:43 +02:00
dependabot-preview[bot]
f0d4565815 Bump email_spec from 2.1.1 to 2.2.0
Bumps [email_spec](https://github.com/email-spec/email-spec) from 2.1.1 to 2.2.0.
- [Release notes](https://github.com/email-spec/email-spec/releases)
- [Changelog](https://github.com/email-spec/email-spec/blob/master/Changelog.md)
- [Commits](https://github.com/email-spec/email-spec/compare/v2.1.1...v2.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-09-12 21:18:16 +00:00
Javi Martín
ed99e4db5b Fix share message interpolation variable
The variable `org` was renamed to `handle` in commit b4ecd07f. However,
some languages were still using the old variable name.
2019-09-12 22:15:40 +02:00
DenisNikolski
6f085b5696 add search form on admin booths 2019-09-12 23:02:39 +03:00
voodoorai2000
71e6c5713a Add rake task to set the original_heading_id value
By default we want this attribute to be the current heading id for existing investments. If there have been reclassifications, this field should be updated accordingly.
2019-09-12 16:49:01 +02:00
voodoorai2000
488e19f8a0 Add original_heading_id to investments
Investments can be reclassified to a different heading during the participatory budget process.

Whilst we are recording this change of heading in the `previous_heading_id` attribute, we are only keeping the _last_ heading. If there are multiple reclassifications we lose this chain of reclassifications.

In this commit we are adding an `original_heading_id` attribute, that will only be set once, when creating the investment, and will not get lost with multiple reclassificaitons of an investment.
2019-09-12 16:49:01 +02:00
Javier Martín
f5fcb9ca06 Merge pull request #3697 from consul/help_wanted
Update README link to PRs welcome
2019-09-12 13:41:58 +02:00
Javi Martín
7e3eb28ce1 Update README link to PRs welcome
GitHub treats help-wanted as a special label, so we're using it instead
of PRs welcome.

I'm still keeping the "PRs welcome" text and icon because it sound less
aggressive than "help wanted".
2019-09-12 13:31:16 +02:00
Javier Martín
f5a6df4316 Merge pull request #3692 from consul/admin-booth-assignments
Hide polls created by users on admin poll booth assigments
2019-09-12 12:54:42 +02:00
Javier Martín
760deb1682 Merge pull request #3613 from consul/dashboard-related-content
Add related content section on proposal dashboard
2019-09-12 12:52:32 +02:00
Javier Martín
26c83febf2 Merge pull request #3612 from consul/selected-proposals
Hide information on selected proposals
2019-09-12 12:52:22 +02:00
decabeza
0ff7a327b7 Refactor selected proposals specs 2019-09-11 22:18:56 +02:00
decabeza
8440208597 Hide comments count on selected proposals 2019-09-11 22:18:43 +02:00
decabeza
1a0f0215a7 Hide related content on selected proposals 2019-09-11 22:18:42 +02:00
decabeza
b15048ec7d Hide proposal code on selected proposals 2019-09-11 22:17:40 +02:00
decabeza
e879fddba4 Hide view mode on selected proposals list 2019-09-11 22:17:40 +02:00
dependabot-preview[bot]
a736252c4b Bump i18n-tasks from 0.9.25 to 0.9.29
Bumps [i18n-tasks](https://github.com/glebm/i18n-tasks) from 0.9.25 to 0.9.29.
- [Release notes](https://github.com/glebm/i18n-tasks/releases)
- [Changelog](https://github.com/glebm/i18n-tasks/blob/master/CHANGES.md)
- [Commits](https://github.com/glebm/i18n-tasks/compare/v0.9.25...v0.9.29)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-09-11 20:02:35 +00:00
Javier Martín
8670cafa2e Merge pull request #3611 from PierreMesure/adding-missing-subtasks-to-upgrade-task
Adding missing subtasks to upgrade task and adding info log
2019-09-11 21:26:45 +02:00
Javier Martín
be34a030a1 Merge pull request #3661 from consul/fix_investment_selection
Fix table layout after selecting an investment
2019-09-11 20:18:31 +02:00
decabeza
abf04bea4c Add related content section on proposal dashboard 2019-09-11 19:45:19 +02:00
Javi Martín
cf5b538c1c Check page between AJAX requests
While the test should work without this assertion, the intention of the
test is to check what happens if a user selects and investment and, once
it's selected, clicks the "next" link.
2019-09-11 19:38:35 +02:00
Javi Martín
9d6ed7a085 Show only defined columns on inserted rows
When we were inserting a row or replacing an existing one (just like we
do when we click the link to select an investment), we were entering a
row containing all columns, and all of them were displayed even if they
had been excluded using the column selector.

This caused the table to move in a strange way, which sometimes made the
investment selection tests fail.
2019-09-11 19:38:34 +02:00
Javi Martín
c6fc0062d7 Fix typo 2019-09-11 18:49:59 +02:00
decabeza
08e820c134 Hide polls created by users on admin poll booth assigments 2019-09-11 18:44:32 +02:00
Javier Martín
cb6539d170 Merge pull request #3537 from PierreMesure/set-locales-in-test-environment
Set locales in test environment to avoid failed specs
2019-09-11 18:43:03 +02:00
Javi Martín
7f8474ea95 Reduce locales used in remote translations tests
This way we can reduce the number of locales used in the test
environment as well, while still testing every possible scenario for
remote translations.
2019-09-11 16:33:25 +02:00
Javier Martín
88afeda085 Merge pull request #3656 from consul/fix_alert_text
Fix text confirming investment heading support
2019-09-11 15:34:50 +02:00
Javier Martín
f362939eb3 Merge pull request #3653 from consul/migrate_coffeescript
Migrate CoffeeScript to JavaScript
2019-09-11 15:30:44 +02:00
Javi Martín
8231096854 Add JavaScript rule to disallow array constructors
Using `Array(0, 1, 2)` will *not* create an Array with the elements
[0, 1, 2]. This is a mistake I've seen in the past, and the JavaScript
community recommends adding this rule.
2019-09-11 14:03:24 +02:00
Javi Martín
af6a494344 Apply JavaScript rule to use the dot notation
We were using the dot notation in most places, but not everywhere.
2019-09-11 14:03:24 +02:00
Javi Martín
25bfd01e69 Add JavaScript rule to return a value in callbacks
It's very easy for Ruby developers to omit the `return` statement in an
array callback, such as the ones in `map` or `filter`. Doing so will
make those funcions have the same effect as `forEach`, which is usually
not the intended behaviour.
2019-09-11 14:03:24 +02:00
Javi Martín
044da18af1 Apply JavaScript rules to prevent shadowing
Using the same variable name makes the code more difficult to read.

We're also enabling the `no-param-reassing` rule since we accidentally
reassigned params in commit 824dd26d, and this rule will prevent us from
doing so in the future.
2019-09-11 14:03:24 +02:00