Commit Graph

44 Commits

Author SHA1 Message Date
Andy Sims
74fbde09f1 Support creates follow (Merge pull request #3895)
* Supporting a proposal will create a follow relationship
* Only followers receive notifications
2020-04-06 15:26:47 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Senén Rodero Rodríguez
78c2f54c5d Fix proposal specs
After adding proposal translatable fields to forms, they will be generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:19:36 +02:00
Javi Martín
307cf24846 Use describe on feature tests
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.

Because of this change, we also need to change `background` to `before`
or else these tests will fail.
2019-05-28 16:36:54 +02:00
decabeza
f40787561d Remove all references to question and external_url fields 2019-04-30 16:42:07 +02:00
decabeza
0995480b73 Remove question and external_url fields from proposals 2019-04-30 11:35:47 +02:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javier Martín
b1996e5694 Check page between AJAX requests in proposals spec.
There was a flaky spec supporting proposals. It's hard to reproduce and
be sure about what was going on, so here is my best guess. Given the
code:

```
within(".proposals-list") { click_link proposal.title }
within("#proposal_#{proposal.id}_votes") { click_link('Support') }
```

The first clicked link generates an AJAX request. Usually, Capybara
would wait for the AJAX request to generate a "Support" link in the
element `#proposal_XX_votes`. However, there's already a
`#proposal_XX_votes` element with a "Support" link on the proposals
index page!

So Capybara doesn't have to wait for the AJAX request to finish before
clicking the "Support" link. From then on, anything can happen.

Another option that works:

```
within(".proposals-list") { click_link proposal.title }
within(".proposal-show #proposal_#{proposal.id}_votes") { click_link('Support') }
```

With this code, the link selector fails on the proposals index page, and
Capybara waits for the AJAX request to finish.

Related to issue #2558.
2018-07-04 00:00:51 +02:00
Angel Perez
dfbf4b8489 Refactor spec to use let syntax to DRY scenarios 2018-03-27 14:47:51 -04:00
Bertocq
2f27a86034 Replace deprecated capybara only_path option for ignore_query 2018-01-11 00:07:56 +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
f6aed3f9f1 Enable RSpec/ExpectActual cop and fix all issues
Always use a variable and not a literal as `expect` argument

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
2018-01-07 01:55:38 +01:00
Bertocq
7f14544f71 Enable Capybara/CurrentPathExpectation cop & fix issues
Read cop description http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation to better understand reasons behind enforcing this rule

On some cases the `only_path: true` was needed as argument of `have_current_path` matcher to avoid comparing the url parameters and just checking the path.
2018-01-06 23:31:41 +01:00
Bertocq
22822aa173 Fix Style/RedundantParentheses rubocop issues 2017-09-25 22:44:58 +02:00
Angel Perez
2181a65bc2 Allow only YouTube/Vimeo URLs on 'video_url' attribute
Fixes #1841

On branch aperez-valid-video-url
  Changes to be committed:
    modified:   app/models/proposal.rb
    modified:   spec/factories.rb
    modified:   spec/models/proposal_spec.rb

Allow only YouTube/Vimeo URLs on 'video_url' attribute

Fixes #1841

On branch aperez-valid-video-url
  Changes to be committed:
    modified:   app/helpers/embed_videos_helper.rb
    modified:   app/models/proposal.rb
    modified:   spec/features/management/proposals_spec.rb
    modified:   spec/features/proposals_spec.rb
    modified:   spec/features/tags/proposals_spec.rb
    modified:   spec/models/proposal_spec.rb
2017-09-13 08:35:59 -04:00
Bertocq
28970c6701 Fix all Style/UnneededInterpolation rubocop issues and remove from rubocop_tod 2017-07-04 22:44:08 +02:00
decabeza
2e0b17afcf updates specs 2017-06-16 13:23:11 +02:00
Alberto Garcia Cabeza
7ef9bafbf9 fixes specs of remove link on debates and proposals description 2016-12-07 18:42:56 +01:00
kikito
dea1a28a69 purges simple_captcha 2016-04-27 16:07:47 +02:00
Juanjo Bazán
1d931e7943 removes unnecessary :js 2016-04-06 19:05:00 +02:00
Julian Herrero
c44745e0b4 add feature test for management proposals friendly urls 2016-03-02 16:01:57 +01:00
kikito
cf31e89204 Fixes issues in moderation spex related with comment sort 2015-11-02 15:54:15 +01:00
Alberto Garcia Cabeza
2b5a184bfe Updates texts for tests 2015-10-28 14:03:02 +01:00
Alberto Garcia Cabeza
abad54d01a Updates tests with new texts 2015-10-28 12:47:51 +01:00
Juanjo Bazán
bdb9e1a45e adds spec for managed user info in management 2015-10-23 14:00:00 +02:00
Juanjo Bazán
b5c1f4f237 removes uri parsing in favor of current_path 2015-10-23 13:19:03 +02:00
Juanjo Bazán
2a286c6b33 shows proposal view inside management layout 2015-10-23 12:56:09 +02:00
rgarcia
786986053b tests print button present 2015-10-20 14:50:26 +02:00
rgarcia
8acd119b19 displays only the first 5 proposals to print 2015-10-20 14:45:59 +02:00
Juanjo Bazán
2a4495fd36 defaults proposal print list to confidence_score 2015-10-17 13:44:15 +02:00
Juanjo Bazán
89cc26c261 adds managers login via ManagerAuthenticators 2015-10-15 15:57:53 +02:00
rgarcia
dc93ea6dba displays proposal created within management layout 2015-10-13 15:00:23 +02:00
rgarcia
06e35a032d updates specs with menu links 2015-10-13 14:20:11 +02:00
rgarcia
3fe8b6e603 adds consistency to spacing 2015-10-11 16:50:27 +02:00
rgarcia
6b22d98a13 fixes typo 2015-10-08 18:31:58 +02:00
rgarcia
33ee1a159f cleans up 2015-10-08 18:27:26 +02:00
rgarcia
2928b6ded5 refactors manager specs 2015-10-08 18:17:32 +02:00
rgarcia
b532982440 adds filtering spec for manager printing proposals 2015-10-08 18:09:31 +02:00
rgarcia
4afff52968 adds searching spec for manager proposals 2015-10-08 18:05:44 +02:00
rgarcia
ea6ef5996f refactors manager login to spec helper 2015-10-08 15:39:42 +02:00
rgarcia
c21a78e164 checks for verified users when creating and voting proposals 2015-10-08 15:37:59 +02:00
rgarcia
5560c84b66 adds spec for manager print proposals 2015-10-08 14:56:27 +02:00
rgarcia
22271253d1 adds spec for manager proposal votes 2015-10-08 14:41:00 +02:00
rgarcia
18e66160fe adds manager creating proposals spec 2015-10-08 13:56:51 +02:00