Commit Graph

19 Commits

Author SHA1 Message Date
Javi Martín
4edab79910 Use yes_no trait to simplify creating answers
We lose some variety in our answers, though, but on the plus side, we
reduce the risk of trademark issues :P.
2019-09-24 21:34:06 +02:00
decabeza
3855bf26ad Allow users to delete dashboard polls 2019-05-31 11:55:23 +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
Javi Martín
55c8fa3297 Fix obsolete respond_with_bip usage
Since we removed the `best_in_place` gem, this method doesn't exist
anymore. We're replacing it with what the method actually does.

Note the test doesn't check the poll is correctly updated. We could add
a `visit proposal_dashboard_polls_path(proposal)` before checking the
"Show results" field, but then we would enter a race condition between
this request and the AJAX request. A proper solution would be to provide
actual feedback to the user so they know the poll has been updated, and
then checking that feedback is present in the tests.
2019-05-09 19:41:04 +02:00
decabeza
20f505ab7c Fix specs 2019-04-29 15:44:41 +02:00
voodoorai2000
6f3b213612 Refactor proposal poll routes
Moving routes from custom file to the proposal's routes file.
2019-04-29 15:43:25 +02:00
voodoorai2000
93972eeb33 Use custom url for proposal poll results 2019-04-29 15:42:27 +02:00
voodoorai2000
93ff173a0d Use a custom url for proposal polls
Before we used the standard poll url (vota/:id) for a user generated poll.

However this url is considered too important for this kind of polls, so we are changing it to a namespaced url (proposals/:proposal_id/polls/:id)
2019-04-29 15:42:04 +02:00
decabeza
e5bff01027 Replace incoming filter on dashboard polls
Add starts_at attribute intead of incoming because this scope doesn't exists anymore.
2019-03-26 18:25:35 +01:00
decabeza
f47ec9d7dc Fix hound warnings 2019-03-26 18:21:19 +01:00
Senén Rodero Rodríguez
5e98c23be5 Fix HTML markup
We cannot use 'id' html attributes on nested answers
because there will be many answers form each question so
this would have generated invalid HTML.
2019-03-21 14:51:17 +01:00
Senén Rodero Rodríguez
bc2d020d7e Add nested specs
Check remove behavior of poll nested resources: Questions and Answers
2019-03-21 14:51:17 +01:00
Juan Salvador Pérez García
42d448248c Routes have been refactored
Dashboard routes have been refactored. Now instead of having resources
for dashboard and routes inside a dashboard namespace the proposal
routes contain a dashboar singleton containing everything related to it.
2018-09-17 15:44:45 +02:00
Juan Salvador Pérez García
5b5095b37b Bugfixing and several enhancements
* Added missing specs
* Removed models that were refactored previously
* Added simplecov when executing specs locally
* Fixed bug in poll model validation that was causing an 500 error.
2018-08-01 13:26:30 +02:00
Juan Salvador Pérez García
3b37b4b09d Fixes #238
Applies new card design for polls in proposals dashboard.
Fixes warnings during tests.
Adds tests for new card design for polls in proposals dashboard.
2018-07-23 10:31:50 +02:00
Juan Salvador Pérez García
4b8cc85c49 Fixes #234
View questions now is View results and redirects to results
in public view.

Fixed flaky spec that was making the tests fail.

Added missing specs for polls feature as well as poll model.
2018-07-19 17:15:05 +02:00
Juan Salvador Pérez García
6bb9b1be8a Fixed failing specs
Fixed failing specs after redesign of polls in dashboard
2018-07-17 17:59:11 +02:00
Juan Salvador Pérez García
084e9855e4 Fixed some failing specs 2018-07-17 17:57:30 +02:00
Juan Salvador Pérez García
2be107f4da Specs
Added specs and fixed some issues found after executing them
2018-07-17 17:57:30 +02:00