Commit Graph

10 Commits

Author SHA1 Message Date
Bertocq
e59ed81528 Return 404 accesing community without communitable
Why:

Somehow we're seeing communities without proposals at production. We
must find why and fix it, but first we need to throw a 404 at the user
instead of a 500 internal server error

How:

First catching the scenario of non-existent communitable at the
controller and raising a 404 error. Secondly preventing the author_id
access over a possibly nil object, this is a smell but it can't be
easily fixed right now... we need to correctly implement a relation
between Community and communitable and avoid the multiple occurences of
`community.from_proposal?` in the codebase that makes it impossible to
extend to a fourth communitable model.
2018-01-23 00:22:53 +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
a71ad644c5 Fix community topics specs 2017-12-14 13:51:10 +01:00
decabeza
2948251fc2 updates specs 2017-09-21 18:31:30 +02:00
taitus
9b6b57a24c Remove all white spaces 2017-09-06 14:12:32 +02:00
taitus
5ea16976f7 Refactor communities controller. Add missing specs on topics order. 2017-09-06 12:34:38 +02:00
taitus
9c7cd7d864 Fix features communities spec 2017-09-05 12:55:12 +02:00
taitus
5d22558c2b Fix specs 2017-09-05 12:54:32 +02:00
taitus
e1a7f9c58c Add community to Global Settings 2017-09-05 12:54:32 +02:00
taitus
4539c5fa00 Refactor and tests. 2017-09-05 12:52:14 +02:00