Commit Graph

8839 Commits

Author SHA1 Message Date
Bertocq
f0dc2a02a5 Add Budget#formatted_amount unit test 2018-03-08 11:42:22 +01:00
Bertocq
b72e43168b Use user locale instead of default locale to format currencies 2018-03-08 10:20:05 +01:00
Bertocq
a92ef57bf8 Make valuator spec 100 LineLength compliant
Readability of the code is important
2018-03-06 20:17:40 +01:00
Bertocq
7145ce5e5a Refactor Valuator spec Show context with lets
Extract duplicated code used to set the scenario conditions to simple
lets (admin, second valuator and investment)
2018-03-06 20:17:39 +01:00
Bertocq
400b3b1201 Swap @investment instance variable for a let
Why:

Avoid instance variables as we agreed upon with RSpec/InstanceVariable

How:

Using a let(:invsetment) and replacing all `@investment` with
`investment`, as well as adding a let(:admin) for the administrator.
2018-03-06 20:17:39 +01:00
Bertocq
9abf9bd87d Swap @budget instance variable for a let
Why:

Avoid instance variables as we agreed upon with RSpec/InstanceVariable

How:

Using a let(:budget) and replacing all `@budget` with `budget`
2018-03-06 20:17:38 +01:00
Bertocq
0a066f6bb6 Swap @valuator instance variable for a let
Why:

Avoid instance variables as we agreed upon with RSpec/InstanceVariable

How:

Using a let(:valuator) and replacing all `@valuator` with `valuator`
2018-03-06 20:17:37 +01:00
Alberto Calderón Queimadelos
8456b74ce1 Merge pull request #2515 from consul/improve_pull_request_template
Improve Github's Pull Request Template file
2018-03-06 12:05:12 +01:00
Bertocq
d0c7bae364 Improve Github's Pull Request Template file
The actual PR template feels more like bureaucracy than an actual guide
or checklist to help the PR author explain all important thigs that any
reviewer or changelog reader may need to understand.

We'll be moving most of the redundant things (like remembering tests are
needed, or explaning how things where implemented with a clear and
granular commit history) into a Wiki/Doc entry.

For regular contributors there is no need for reminders, we need to
improve new contributors landing with good guides and lowering the bar
for first PR's
2018-03-06 11:05:31 +01:00
Alberto Calderón Queimadelos
28eab38ea0 Merge pull request #2516 from consul/fix_user_segment_emails
Remove empty emails from user segment usages
2018-03-05 14:08:03 +01:00
Alberto Calderón Queimadelos
18aa23fb3e Merge pull request #2513 from consul/fix_debates_spec_back_link
Flaky spec fix: Debates Show: "Back" link directs to previous page
2018-03-05 11:22:37 +01:00
iagirre
ffd6bdb3d7 first changed for click_link so that the test can wait the capybara default time. 2018-03-04 22:58:35 +01:00
Alberto Calderón Queimadelos
9747386575 Merge pull request #2506 from consul/fix_email_spec_comment_failues
Fix Email Spec comment random failures
2018-03-02 15:06:32 +01:00
iagirre
e21588ec16 The function comment_on has been modified to change the functionality. Now, a comment is generated and a email notification send manually, so that JS has been avoided, that was the original problem. 2018-03-02 13:35:50 +01:00
Bertocq
6b41b6487b Add UserSegments#user_segment_emails helper method
Why:

Both Newsletters and Email Downloads need the same logic: To extract the
emails from all the users in the segment that have newsletter flag
active, removing all empty email values.

How:

1- UserSegments#user_segment_emails holds that repeated logic and is used
on both Newsletter & EmailDownload.

2- Rename Newsletter#list_of_recipients to list_of_recipient_emails as
it is more descriptive. There is no need to pass entire Users around,
only the emails are needed at Mailer#newsletter method.

3- Cleanup Newsletter#list_of_recipient_emails model spec scenario
2018-03-01 20:59:20 +01:00
Bertocq
99851e9588 Remove empty emails from users segments recipients
Why:

User with an empty email value (nil) should not appear in the recipient
list for a given UserSegment at Newsletters or Email Downloads.

How:

Using Enumerable#compact and Enumerable#select to filter out empty emails

Increasing Email Download feature spec and Newsletter model spec to cover
all possible scenarios including the nil email one.
2018-03-01 20:09:32 +01:00
Bertocq
089cef8ead Improve download segment translations 2018-03-01 13:52:48 +01:00
Alberto Calderón Queimadelos
0decaf43a3 Merge pull request #2492 from consul/fix_newsletter_send_performance
Fixed how newsletters controller and mailer handle recipients
2018-02-28 19:03:58 +01:00
Bertocq
61c58817fc Update unreleased section of changelog 2018-02-28 18:09:46 +01:00
Alberto Calderón Queimadelos
4af603edc6 Merge pull request #2491 from consul/2487-feasible_undecided_investment_authors_segment
Fix UserSegment feasible and undecided investment authors
2018-02-28 18:01:54 +01:00
Alberto Calderón Queimadelos
0acb4988f0 Merge pull request #2490 from consul/documents-tab
Documents list
2018-02-28 17:14:58 +01:00
María Checa
3867c6b716 Fixed newsletter tests 2018-02-28 17:02:39 +01:00
María Checa
8d2a103744 Changed how newsletters controller and mailer handle recipients
Now newsletters controller calls the Mailer method to send a newsletter once per user.
2018-02-28 17:02:31 +01:00
Alberto Calderón Queimadelos
494904565a Merge pull request #2489 from consul/ui-fixes
UI fixes
2018-02-28 16:56:57 +01:00
María Checa
6140a822e8 Changed translations 2018-02-28 16:55:53 +01:00
María Checa
7913128520 Changed tests for UserSegments#feasible_and_undecided_investment_authors 2018-02-28 16:54:28 +01:00
María Checa
678ea0bef2 Added unfeasible investments with valuation not finished to UserSegments#feasible_and_undecided_investment_authors 2018-02-28 16:54:28 +01: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
decabeza
1546f67367 Removes document tab on legislation proposals 2018-02-28 16:21:08 +01:00
decabeza
7a888b71fd Removes duplicate heading info, fixes headings structure 2018-02-28 16:10:14 +01:00
decabeza
46f21330bd Removes document tab on budgets investments 2018-02-28 15:23:39 +01:00
decabeza
5b7a5a2b4b Removes document tab on proposals 2018-02-28 15:23:32 +01:00
decabeza
466f8ef4e0 Removes unnecessary css 2018-02-28 15:23:22 +01:00
decabeza
5c0a10699a Refactors documents partials and reorganices css 2018-02-28 15:22:33 +01:00
decabeza
bd3929a7dc Adds missing translation for legislation filter title 2018-02-28 15:19:44 +01:00
decabeza
ddc4ff329b Fixes button vertical align on polls list 2018-02-28 15:19:33 +01:00
Bertocq
c2e9096ce1 Improved user segments en & es translations 2018-02-26 16:56:28 +01:00
Alberto Calderón Queimadelos
f5f37829e0 Merge pull request #2486 from wairbut-m2c/docs/nodejs-requirement
docs(readme): Include Node.js as requirement
2018-02-26 16:17:41 +01:00
Angel Perez
9443e585c6 docs(readme): Include Node.js as requirement
Failed CONSUL installation reported on #2391 because
Node.js was missing on the development environment
2018-02-26 10:33:22 -04:00
Bertocq
dbe723079e Disable guide page when Budget is not accepting
Why:

When there is not Budget accepting (Investment creation) the guide page
doesn't have much sense as it will give the user an option that can't be
used (creating an Investment).

How:

Using `Budget.current&.accepting?` conditional at GuidesHelper to link
to new proposal link instead of guide page, and adding an scenario to
guides feature spec for it.
2018-02-26 10:01:30 +01:00
Bertocq
c3a3e76304 Improve newsletter model spec list_of_recipients 2018-02-22 18:24:36 +01:00
Bertocq
e3eeca4f06 Improve newsletter model spec with valid_segment_recipient? 2018-02-22 18:24:18 +01:00
Bertocq
d44621f761 Relocate spending proposal valuation assigment seed 2018-02-22 11:38:49 +01:00
Bertocq
500db4b5d8 Add translations used on dev seeds files 2018-02-22 11:04:49 +01:00
Bertocq
54e6c5fc5c Split dev_seeds into individual files for sections
Why:

Its a really huge script, and conflicts are hard to resolve on forks,
with indivudal scripts its easier to make custom changes.

How:

Following @mariacheca example using require_relative and a file under
the db/dev_seeds/ folder
2018-02-22 11:04:47 +01:00
Bertocq
7d88b25741 Revert "Revert default map change"
This reverts commit 418dc6a1d6.
2018-02-22 07:40:59 +01:00
Bertocq
65288573b5 Fix user administrators scope relation 2018-02-22 00:42:40 +01:00
Bertocq
61f015e2c2 Add administrators UserSegment
We need a user segment to have only administrators as recipients of both
newsletters and notifications
2018-02-21 23:34:20 +01:00
María Checa
4bf20e5bd9 Removed rubyzip gem from Gemfile.lock 2018-02-21 16:06:55 +01:00