Commit graph

110 commits

Author SHA1 Message Date
Molly Struve
4e2cbe9b9f
Add Feature Search Tests for Users and Articles (#7745) 2020-05-08 17:06:05 -04:00
rhymes
64943016c4
Decouple GithubReadmeTag liquid tag from GitHub auth (#7707)
* Decouple GithubReadmeTag from GitHub auth

* Remove commented code

* Remove unused VCR file

* Fix spec and improve error handling
2020-05-08 13:09:27 +02:00
rhymes
ae8a58fec2
[deploy] Decouple GitHub authentication from fetching GitHub issues (#7660)
* Improve error handling

* Add tests for Github::Client

* Add GithubIssue validation

* Refactor GithubIssue and fix bug with pull requests

* Improve tests

* Fix PR API URL generation

* Improve logic and get rid of the issue fragment

* Fix disappeared avatar

* Improve rendering

* Activate client side caching using Redis

* Remove unnecessary file

* Add RemoveGithubIssues data update script

* Fix comma

* Forgot to disable the approvals verify text

* Apply PR feedback
2020-05-04 16:17:16 -04:00
rhymes
c7c498834f
[deploy] Authentication refactoring: generalize account settings (#7597)
* Rename remove_association to remove_identity and future proof its tests

* Use the signin_path everywhere

* Generalize account settings

* Use delegation
2020-04-30 17:29:53 +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
Molly Struve
4c779be2ed
[deploy] Remove ALL Algolia Code (#7577) 2020-04-29 10:11:57 -05:00
rhymes
8407bf9b4e
[deploy] Authentication refactoring: cleanups (#7576)
* Use Devise registry to list available providers

* Cleanups following Devise+Omniauth docs

* More cleanups

* Use helpers

* More cleanups

* Oops, forgot to remove these specs
2020-04-29 10:33:30 -04:00
rhymes
178a049262
Add SVG optimizer (#7542) 2020-04-28 08:28:25 -04:00
Molly Struve
5bf12a51d7
Clear Elasticsearch data for user viewing timeline specs (#7549) 2020-04-27 17:11:47 -05:00
Maja Komel
4499e5eb6e
[deploy] Add Wikipedia liquid tag (#7193) 2020-04-22 17:54:56 +02:00
Molly Struve
13e8ea1f64
Ensure records are updated properly after a user merge (#7416) 2020-04-21 14:17:11 -04:00
Ridhwana
a2f1a0049f
Removal of morrrre hardcoded dev.to links (#7390)
* feat: remove 90% of hardcoded dev.to links now

* chore: update tests

* chore: implement suggested changes

* chore: update url

* chore: update to use URL helper
2020-04-21 11:50:18 +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
d6e47a03c7
[deploy] Authentication refactoring - step 1 (#7259)
* Add Authentication providers

* Making strides on refactoring

* New usr from Twitter

* Existing Twitter user

* Existing user Github

* Test skip_confirmation!

* Refactor a bit and add simplecov groups

* Test user already logged in

* Rename to Authentication::Authenticator

* Refactor to a common class

* Add existing user test for twitter login

* Refactor global handler

* Fix spec and comment Twitter provider

* Update comments and strategy TODO

* Move providers loading code to Authentication::Providers

* add SubclassResponsibility error

* Use delegation
2020-04-15 12:13:10 -04:00
Ridhwana
6c8cbabdff
Remove unused file and fix social media icon css on information page (#7295)
* chore: does not look like this file is being used anywhere

* fix: the svg's didn't seem to be resizing because we did not have a viewBox tag on the svg

* chore: update spec file
2020-04-15 13:22:28 +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
ludwiczakpawel
19da53450e
[deploy] Profile link fix (#7019)
* wtf

* fix

* gitattributes

* test ???
2020-04-02 19:33:17 -04:00
rhymes
a58596f25f
Correctly save Tweet reply ids (#6951) 2020-03-31 11:09:19 +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
ludwiczakpawel
61b913e5e8
Replacing theme variables (#6682)
* add tons of colors

* add tons of colors

* moving cheese around and prepping for new theming system

* documenting

* .

* moving theme code to own files

* replacing some variables

* whitespaces

* replacing another batch of variables

* get rid of another variable

* replace loading animation variable with one-fits-all-sizes

* get rid of theme-anchor-color

* remove code colors variables

* another batch of variables replaced

* mostly bringing in variables for haxor theme

* remove invert-image variable for chat

* remove another inver-image variable

* forgot to remove reaction-background variable

* remove border variable

* series

* .

* remove another variable

* remove another variable..

* another batch of variables

* and more...

* drop comments

* Update approval file for tweet

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-03-24 15:05:35 +01:00
rhymes
b8b321c13d
Fix VCR warnings and use initializers (#6672) 2020-03-17 15:51:07 +01:00
Mac Siri
8e4905522d
Implement KatexTag (#6237) [deploy]
* Install Katex gem

* Add Katex stylesheet and spec

* Implement basic error handling

* Remove comment

* Create more spec

* Update approval file

Changes is due to turning off RedCarpet's superscript feature

* Add instruction to _editor_guide_text

* Serve our own KaTeX css

* Apply Rhyme's suggestion

* Limit Katex's css use

* Update spec

* Add spec

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-09 17:58:54 -04:00
Alex
e40c28117b
Search ClassifiedListings backend code (#6348)
* Add search methods

* Add spec for new search methods

* Add QueryBuilder for ClassifiedListing

* Add QueryBuilder spec for ClassifiedListing

* Refact build_query in ClassifiedListings

* Refactor logic for filter and query conditions

* Refactor index_documents to helper_method

* Update elasticsearch helper for single objects

* Refactor specs from stubbing to record update

* Update search and specs for query_builder

* Refactor set_size

* Update Search::ClassifiedListing

- Add DEFAULT_PAGE constant
- ADD DEFAULT_PER_PAGE constant
- Add pagination

* Fix paging

* Add pagination specs

* Remove manual Array conversion for Array.wrap()

* Change guard clause to .key? for readability
2020-02-28 10:51:33 -05:00
rhymes
168f5c597c
Bump Twitter to 7.0 and refactor TwitterBot (#6246) [deploy] 2020-02-24 08:34:41 -05:00
rhymes
207621f739
Ignore User.organization_id (#6203)
* Ignore User.organization_id

* Fix specs that are still using organization_id
2020-02-21 09:51:49 -05:00
rhymes
f3c2adfa45
Routine rubocop fixes (#6138) 2020-02-18 11:21:42 -05:00
Molly Struve
65eba740ab
Document DataUpdateScripts, Add to Deploy Process, Add Development Check (#6068) [deploy] 2020-02-14 11:45:27 -05:00
Molly Struve
0bfbd9bb1f
Set Up Framework For Running Data Update Scripts (#6025) [deploy] 2020-02-13 10:48:23 -05:00
rhymes
7cda85d644 Fix error handling bugs in stackexchange tag (#5490) 2020-01-20 14:43:25 -05: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
rhymes
97d188264f Add worker: option to sidekiq_enqueued_jobs to return also jobs by worker (#5334) 2020-01-03 14:54:44 -05:00
rhymes
73188cd836 Sidekiq: add test helpers (#5326) 2020-01-02 08:39:40 -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
Andrew Sverdrup
2af033fca9 Add Next Tech Liquid Tag (#4958) [deploy]
* Add liquid tag for Next Tech

* Add liquid tag for Next Tech

* Use project share URL in liquid tag.

* Update docs and specs with share token URL.
2019-12-10 15:19:30 -05:00
Molly Struve
834eb51e98
Replace Airbrake with Honeybadger (#5007) [deploy] 2019-12-05 11:29:51 -06:00
Mac Siri
2ee4e703eb
Remove disable_indented_code_blocks (#4988) [deploy]
We have decided enable indented-code-block because it is an expected
markdown feature. The trade-off here is that backticks will cause
rendering issues in codeblock.
2019-12-03 13:04:53 -05:00
Anthony Musyoki
2537670968 Refactor raise_error(specific_error) expectation (#4912)
* Refactor raise_error(specific_error) expectation

The full RSpec warining is
```
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives,
since literally any other error would cause the expectation to pass,
including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError),
meaning the code you are intending to test may not even get reached.
Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`.
```

* Refactor jsitor tests to test behaviour

As pointed out by @rhymes, the previous tests were not
testing actual behaviour. This is an attempt at improving the tests.
2019-11-26 08:46:33 -05:00
rohan-techfreak
bf867a624a Add lazy loading to iframes (#4673) 2019-11-18 18:31:56 -05:00
aRtoo
9b5b2ee98d Redo JSitor (#4762) [deploy]
* Redo JSitor
- can now accept full url with params
- added more test
- redo jsitor guide

* Jsitor redo guide
- moved below JSFiddle
- add more instructions

* Refactor JSitor liquid tag
- Change the iframe size to 400
- can accept ID with or without params
- added ID_REGEX to check for id
- add more information on error
- added more test
  - test for id with invalid link
  - test for id with params
  - test for id without params

* Refactor
- simplified regex, removed unnecessary groupings
- changed method name from link_valid? to validate_link
- changed error message
2019-11-14 09:17:47 -05:00
aRtoo
b421ad908b Add JSitor liquid tag (#4657) [deploy]
* Request change
- Added specific error message
- changed jsitor to JSitor
- changed JSITOR_URL constant to URL_REGEXP
- added space between URL_REGEXP and initialize method

* created jsitor liquid tag
- created a jsitor_tag.rb for jsitor liquid core
- created partial (_jsitor.html.erb) for jsitor liquid tag

* created test for jsitor liquid tag
- created spec for jsitor liquid tag
- generated jsitor_liquid_tag.approved.html

* added suggestion change
- removed regex
- change the full link to embeddable id
- removed dead code(methods) due to change logic
- removed checking of link since embeddable id will be parse as string
- removed parts of the test
- change the guide explanation

* Added lazy loading on iframe
2019-11-05 09:43:52 -05:00
Huynh Tan
b6a731276e Fix answers from other stackexchange sites have the wrong link (#4615) [ci skip] 2019-10-30 15:01:29 -04:00
rhymes
d6d251e9ce Remove unused spec support BackgroundJobs (#4464) [ci skip] 2019-10-24 16:49:45 -04: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
John Curcio
bfef186684 Fix medium liquid tags scraping (#3485) (#4120)
* Scrape medium tag information using page meta tags (#3485)

* Add tests for medium liquid tag service
2019-10-01 10:29:25 -04:00
Jean-Michel Fayard
4af02c8a48 Support for runnable kotlin snippets #3776 (#3801) 2019-08-29 16:06:17 -04:00
John Curcio
0f2ae535c8 Removes temp .received file (#3731) (#3821) 2019-08-25 12:30:27 -04:00
Ben Halpern
3443fdf2bd
Create endpoint for liquid tag embed (#3813) 2019-08-23 17:42:04 -04:00