Commit graph

37 commits

Author SHA1 Message Date
Tudor Pavel
65336d6ff3
Fix RSpec unit testing when using Docker dev setup (#10950) 2020-10-20 10:36:41 -04:00
Molly Struve
cf443c3ae7
Refactor:Remove Screenshot Monkey Patch (#10520) 2020-10-02 16:53:26 -05:00
Molly Struve
b40af82b66
Flaky Spec Fix:Remove let_it_be Test Prof Helper (#9556)
* Flaky Spec Fix:Remove let_it_be Test Prof Helper

* Spec cleanup and fixes
2020-07-29 11:31:01 +02:00
rhymes
bbd56875c7
Rubocop: address feedback of #9430 and use kwargs (#9538)
* Use fetch.to_i

* Rubocop: address feedback of #9430 and use kwargs
2020-07-29 11:13:36 +02:00
rhymes
0b4ad49cf8
Rubocop: Enable and fix Style/OptionHash (#9430)
* Enable and fix Style/OptionHash

* Add 10 seconds default timeout to DB statements
2020-07-25 10:41:21 +02:00
rhymes
88f0a0e58a
Rubocop: re-activate Style/RegexpLiteral and fix violations (#9418)
* Rubocop: re-activate Style/RegexpLiteral and fix violations

* Add 10 seconds default timeout to DB statements
2020-07-22 16:28:27 +02:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Zach Attas
db468a6cfc
Adds ability to run spec not headlessly (#8844) 2020-06-23 08:37:37 -05:00
Zach Attas
d380077592
adds travis branch to ci formatter (#8825) 2020-06-22 13:52:51 -04:00
Molly Struve
f647944046
[deploy] Spec Speedup: Use Knapsack to Run Parallel Builds (#8390) 2020-06-11 10:27:11 -05:00
Molly Struve
87c258bdec
Flaky Spec Fixes: Override Warden Test Helpers to Prevent Auth Race Conditions (#8379) 2020-06-10 09:30:36 -05:00
Molly Struve
b0d28aadfd
Actually Replace File Name Colons (#8036) 2020-05-22 15:02:29 -05:00
Molly Struve
a236cec67f
Dont Use Colons In Timestamps For CI CSVs (#8035) 2020-05-22 14:10:15 -05:00
Zach Attas
52277ea0ba
Adds csv formatter only in CI and makes screenshot names unique with timestamp (#7838)
* adds csv formatter only in CI and adds --format progress to rspec in CI

* addressing feedback

* adds more functionality to csv reporter, and makes screenshots taken from rspec/retry have unique names

* induces intentional fails (will revert after testing)

* induces intentional fails (will revert after testing)

* makes screenshot timestamp more precise and tweaks intentional fails (again willremove later)

* restores spec files to normal and tweaks screenshot microseconds

* remove the putses at end of CSVFormatter
2020-05-20 10:40:55 +02:00
rhymes
300ba1b33f
[deploy] Decouple Twitter authentication from fetching tweets (#7920)
* Add TwitterClient::Client

* Use TwitterClient::Client for Tweet

* Test retweets

* Test assignment to user

* Fix TweetTag spec

* Remove TwitterBot

* Fix some specs

* Fix RSS Reader specs
2020-05-19 18:05:41 -04:00
rhymes
e104c8b5c5
Upgrade validate_url to 1.0.11 to fix load error (#7882)
* Upgrade validate_url to 1.0.11 to fix load error

* Fix spec
2020-05-15 16:17:07 +02:00
Mac Siri
2ea320a245
Support docker-selenium (#7583)
* Support use of selenium-docker

* Apply suggestion

* Add documentation
2020-04-30 11:07:45 +02:00
rhymes
0a6be8b967
[deploy] Improve some validations (#7335)
* Validations

* Fix specs

* Revert twitter tag change
2020-04-16 18:59:12 +02:00
rhymes
f2b0be2043
Add Slack messengers: part 2 (#6916)
* Add Slack::Messengers::ArticlePublished

* Add Slack::Messengers::ReactionVomit

* Add Slack::Messengers::CommentUserWarned

* Add missing URL helpers

* Add Slack::Messengers::ArticleFetchedFeed

* Remove callback condition

* Build, don't create
2020-04-03 17:00:06 +02:00
rhymes
336c195228
Remove redundant Puma silencing in system specs (#6905) 2020-03-27 09:51:35 -04:00
rhymes
118762ca9b
Some RSpec fixes (#6757)
* Fix spec/uploaders/profile_image_uploader_spec.rb

* Additional ordering based fixes

* Fix spec/requests/comments_spec.rb

* Fix spec
2020-03-24 13:16:19 -04:00
rhymes
b8b321c13d
Fix VCR warnings and use initializers (#6672) 2020-03-17 15:51:07 +01:00
gverger
c7de0d762b Add let_it_be_readonly to avoid updating variables (#5407)
With let_it_be, we define variables that are created for the whole
context. In case we update them in an example, there might be a
discrepancy between the object and its value in the database, since the
database is cleaned between examples, but not the object itself.

This is what happened here with the `article` object. In one of the
tests, we update its organization, and in another, we reupdate it. The
problem is that the `article` object still thinks it has an
organization, but it has been cleaned in the database. So setting the
same organization id to the object doesn't trigger the SQL query, and
the article in the database still doesn't have an organization attached.

One solution is to use `reload: true` as a parameter of `let_it_be`: it
will reload the object from the database at the beginning of each test. To
make sure we don't have other dormant traps like this one, what I
propose is to either have `reload: true`, or to have the object
readonly to avoid getting to a difference between the object and its
database value.
2020-01-16 10:53:30 -05:00
rhymes
fec196ffe3 Add wait_for_javascript to flaky system tests (#5405) 2020-01-08 13:47:08 -05:00
Molly Struve
39033e33d9 Flaky Spec Fix: Ensure submit requests finish before checking status of user (#5265) 2019-12-27 14:47:08 -05:00
rhymes
d61f8a36a6 Remove Chrome version from Travis.yml (#4555) [ci skip] 2019-10-23 09:15:23 -04:00
Tudor Pavel
d54442f17e Bump Chrome Driver version to fix Travis CI builds (#4554) [ci skip] 2019-10-23 08:20:31 -04:00
Mac Siri
5f85250220
Update to Chromedriver 76 (#3587) [ci skip] 2019-07-30 17:58:21 -04:00
dependabot-preview[bot]
ebefca6a8a Bump capybara from 3.26.0 to 3.27.0 (#3556) 2019-07-30 16:47:08 -04:00
Ben Halpern
df44cbd254
Change design of main feed CTA and remove from tag pages (#3050)
* Change design of main feed CTA and remove from tag pages (to prevent complexity)

* Lock Chromedriver to 74.0.3729.6

* Fix tests and modify reserved words (tack on)

* Removed less useful shared examples from rspec

* Remove references to file that no longer exists in test

* Remove unneeded tests
2019-06-05 14:33:22 -04:00
Mac Siri
6d1638ed68 Unskip all skipped specs (#2941)
* Change all login_as to sign_in

* Unskip comment spec

* Create new specs

* Turn on Webdriver caching

* Set logger for Omniauth in test

* Update editor system spec

* Fix editor approval file

* Update video_controller

* Update TagAdjustmentUpdateService's spec

* Update users api spec

* Update stories_index_spec

* Remove redundant spec file

* Remove residual code

* Change ClassifiedListing spec

* Update NotificationsIndex spec
2019-05-25 11:04:38 -04:00
rhymes
8e6ca966ed Switch from chromedriver-helper to webdrivers (#2465) [ci skip] 2019-04-16 13:46:23 -04:00
cyrillefr
4fd66372dc Enable Layout/AlignParameters (#2340)
Check if the parameters on a multi-line method call or definition are aligned.

Resolves: #2021
2019-04-08 18:47:34 -04:00
Mac Siri
fc39f24ee3 Migrate feature test to system test (#2301)
* Move all features to system

* Remove database_cleaner & apply use_transactional_fixtures

* Move rspec-retry to :test

* Update Capybara config

* Update rails_helper

* Fix user_visits_a_comments_page_spec.rb

* Fix lint
2019-04-04 12:15:10 -04:00
Keshav Biswa
8d57d45ecc Rubocop Style cops enabled (#2056)
* Rubocop enabled style/alias

* Enabled Style/ArrayJoin Cop

* Enabled Style/Attr

* Enabled Case Equality

* Enabled CharacterLiteral

*  Enabled ColonMethodCall Cop

* Enabled CommentAnnotation cop

* Enabled PreferredHashMethods Cop

*  Enabled DoubleNegation Cop

* Enabled EachWithObject Cop

* Enabled EmptyLiteral Cop

* Enabled EvenOdd Cop

* Enabled IfWithSemicolon Cop

* Enabled Lambda and LambdaCall Cop

* Enabled LineEndConcatenation Cop

* Enabled ModuleFunction Cop;

* Enable NegatedIf and NegatedWhile Cop

* Enabled NilComparison Cop

* Enabled Not Cop

* Enabled NumericLiterals Cop

* Enabled OneLineConditional Cop

* Enabled PercentLiteralDelimiters Cop

* Excluded internal/users_controller from negated_if cop

* Reverted the double negation change from github_issue_tag and github_issue.rb"

* Enabled PerlBackrefs Cop

* Changed Regexp.last_match(1) to Regexp.last_match(0)

* Enabled proc cop

* Enabled RaiseArgs Cop

* Reverted Regexp.last_match(0) to Regexp.last_match(1)

* Enabled SelfAssignment Cop

* Enabled SingleLineMethods Cop

* Enabled SpecialGlobalVars Cop

* Enabled VariableInterpolation Cop

* Enabled WhenThen Cop

* Enabled WhileUntilModifier Cop

* Enabled WordArray Cop

* Enabled IfUnlessModifier Cop

* Enabled GuardClause Cop
2019-03-15 18:33:54 -04:00
rhymes
6553f08d94 Rubocop cleanups (#1415)
* Update rubocop-todo.yml with new violations

* Fix Layout/EmptyLine* rules

* Fix Layout/Indentation* rules

* Fix remaining Layout/* rules

* Fix Lint/DuplicateMethods by removing unused accessor

* Fix Lint/IneffectiveAccessModifier

* Fix Lint/MissingCopEnableDirective

* Re-run rubocop auto gen config

* Fix Layout/RescueEnsureAlignment

* Fix Naming/* rules

* Fix some RSpec/* rules

* Fix typos

* Fix RSpec/LetBeforeExamples

* Series should only be an attr_writer, not an attr_accessor

* Fix RSpec/InstanceVariable

* Fix RSpec/InstanceVariable

* Fix RSpec/RepeatedDescription and RSpec/RepeatedExample

* Fix Style/ClassAndModuleChildren

* Fix Style/ConditionalAssignment

* Fix some Style/* rules

* Trigger Travis CI build because failing tests are not failing locally

* Revert "Fix Style/ClassAndModuleChildren"

This reverts commit 1686801d8a1516ba1894f79e24401a20dea65f99.
2019-01-02 11:20:02 -05:00
Mac Siri
32d15f2820 Update test suite configuration (#702)
* Update DatabaseCleaner

* Only retry in CI

* Update rubocop precommit hook

* Update spec

* Restructure spec configs WIP

* Restructure spec configs WIP

* Create OmniauthMacros

* Fix broken spec

* Update spec
2018-09-24 14:40:22 -04:00