Commit Graph

40 Commits

Author SHA1 Message Date
Javi Martín
5ff1162038 Simplify creating follows in specs
While in theory we wouldn't need to use the `transient` nor the
`after(:create)` because there's already a `has_many :through`
association with followers, Factory Bot / ActiveRecord don't
automatically associate the followable, resulting in an invalid record
exception.
2019-09-30 13:34:31 +02:00
Javi Martín
7b0771106e Remove isolated useless assignments
These variables are not surrounded by other assignments, and so they can
safely be removed without making it harder to read the code vertically.
2019-09-25 12:43:44 +02:00
Javi Martín
2ec176a2a8 Remove redundant feature settings enabled in tests
These settings are enabled by default.

It could be argued explicitely enabling the features makes tests more
consistent, because they'll work if we change the default setting. It
could also be argued that it makes tests more expressive because it
makes the reader realize certain things will only work if a setting is
enabled.

However, we were only doing so in a few tests. The truth is, thousands
of our tests depend on certain features being enabled. So IMHO we should
be consistent and either set them on every test, or not at all. I'm
choosing the latter option for simplicity.
2019-09-23 15:15:51 +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
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
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javi Martín
aa45c39d3e Remove trailing whitespace 2018-12-10 12:59:03 +01:00
Javier Martín
ef16efe5e4 Merge pull request #2899 from papayalabs/2980-hide-featured-section-with-no-cards
Hide Featured section on Home Page if there are no cards
2018-12-10 12:55:32 +01:00
Javi Martín
2f860236a5 Reset page driver after every spec using it
There were some issues because some specs  directly used the driver but
didn't reset it after the test.
2018-11-30 13:34:01 +01:00
Papaya Labs
f7c10de627 Fix indentation and include specs 2018-09-18 15:16:31 -05:00
decabeza
304143d051 Updates localization and home specs 2018-05-29 13:22:23 +02:00
rgarcia
eaebf349df Fix specs
Regarding the feature ‘Carousel size’:
There is no need to test styling in specs, it changes too often
There are nice ways to test it, but it seems a little too much right
Review later on
2018-05-28 18:17:26 +02:00
rgarcia
85c08da7a6 Add homepage admin section 2018-05-28 18:17:26 +02:00
Angel Perez
0a6ee897a7 Configure Capybara sessions to reset after each example 2018-03-27 14:47:51 -04:00
Angel Perez
450e8597eb Disable JavaScript on IE-specific scenarios 2018-03-27 14:47:49 -04:00
Bertocq
16eae689f9 Enable RSpec/RepeatedExample cop & fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
2018-01-07 18:46:32 +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
ce0a7f6fad Rubocop autocorrections 2017-10-17 22:00:00 +02:00
Bertocq
5aa063668f Remove no longer used befor block with comments 2017-10-02 19:57:02 +02:00
taitus
edbbe6174b Refactor specs because now recommendations only return results asociated to user interests 2017-08-03 00:23:06 +02:00
taitus
52e3610876 Minimum required by consul core. Remove comments. Fix texts. Decrease size of methods. 2017-08-02 00:15:03 +02:00
taitus
33e13dbfd0 Add missing feature and model specs on proposal and debates. 2017-08-01 18:00:02 +02:00
taitus
fe3bb7a389 Add recommended tab on proposals and debates index. 2017-08-01 16:31:44 +02:00
taitus
c6a9ffc19c Remove recommended investments 2017-08-01 16:28:01 +02:00
taitus
b6d5be3df0 Rename dynamic display to carousel size 2017-08-01 16:28:01 +02:00
taitus
ee0a10855d Calculate carousel size. 2017-08-01 16:28:01 +02:00
taitus
f8c6422b30 Testing links on carousel. Improve tests descripions 2017-08-01 16:28:01 +02:00
taitus
56511a154a Add feature and model specs. 2017-08-01 16:28:01 +02:00
Alberto Garcia Cabeza
151db53a9b fixes specs 2016-12-22 19:06:11 +01:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
Alberto Garcia Cabeza
abad54d01a Updates tests with new texts 2015-10-28 12:47:51 +01:00
David Gil
35933dec9a adds a test for ie alert, faking browser and button click 2015-09-18 01:29:44 +02:00
Juanjo Bazán
e5531aba87 moves highlights and default home page 2015-09-14 19:49:09 +02:00
rgarcia
58357dad2c removes featured debates and proposals 2015-09-14 19:06:16 +02:00
Juanjo Bazán
9928f8a85c adds basic activity page as signed_in_home 2015-09-13 14:25:52 +02:00
rgarcia
339e978237 default order confidence_score for home and debate index 2015-09-08 14:47:58 +02:00
rgarcia
4dd7e14ac4 moves featured debates to home page 2015-08-11 17:26:25 +02:00
rgarcia
4d0f9ae5c3 fixes specs 2015-07-27 11:15:20 +02:00
rgarcia
2eb0602097 fixes specs 2015-07-18 21:37:15 +02:00
rgarcia
223eb06da2 configures capybara [#4] 2015-07-16 17:07:12 +02:00