Commit graph

75 commits

Author SHA1 Message Date
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
Bolarinwa Balogun
41aff162cc Allow upload of multiple images at a time (#3599)
* Allow upload of multiple images at a time

* Update schema.rb
2019-08-18 15:03:14 -04:00
Andy Zhao
0f46b0deed Add Stack Exchange Liquid tag (#3637)
* Add Stack Exchange Liquid tag

* Add Stack Exchange/Overflow tag

* Convert to integers

* Add better error handling

* Make all links open in new tab

* Adjust names and refactor a bit

* Use key for every API call

* Add new lines to end of svg files

* Add better error handling

* Fix edge case where input is not numeric

* Finalize Stackexhange tag design and functionality

* Fix css typo

* Update snapshots

* Fix snapshot back
2019-08-14 15:01:47 -04:00
Bolarinwa Balogun
f1492fa2bd Resolve error with code blocks in numbered lists (#3633) 2019-08-07 10:37:59 -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
Anna Buianova
135d1ddf2b Don't check url and create podcast episode when there's no enclosure url (#3460)
* Don't check url and create podcast episode when there's no enclosure url

* Keep a couple of records of podcast's rss for test
2019-07-12 12:54:14 -04:00
Anna Buianova
3d81753285 Rescue possible SSLError when fetching a podcast (#3374) 2019-07-03 10:36:36 -04:00
Anna Buianova
6395fe48e2 Moved podcast fixtures to their own folder (#3343) [ci skip] 2019-07-01 12:37:28 -04:00
dependabot-preview[bot]
9c6673adc4 Bump rouge from 3.3.0 to 3.4.1 (#3289) [ci skip]
* Bump rouge from 3.3.0 to 3.4.1

Bumps [rouge](https://github.com/jneen/rouge) from 3.3.0 to 3.4.1.
- [Release notes](https://github.com/jneen/rouge/releases)
- [Changelog](https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jneen/rouge/compare/v3.3.0...v3.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update approvals
2019-06-27 17:26:07 -04:00
Anna Buianova
bfa1bdc37f More specs and refactoring podcasts fetching (#3245)
* More specs and refactoring podcasts fetching

* Fixed PodcastFeed references in tests

* Pass podcast_id instead of podcast to CreateEpisode
2019-06-21 21:31:15 -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
briwa
b35fc23a82 refactor(svgs): remove empty group tags (#3002)
* refactor(svgs): remove empty group tags

* fix(spec): update liquid tag twitter spec
2019-05-31 08:54:31 -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
Mohammadjavad Raadi
1a960cfb44 Fix TwitterTag's video control bug (#2869) 2019-05-22 13:32:37 -04:00
rhymes
941ab4178b Articles API: create and update (#2844)
* Add system test to create article from the editor

* Move article creation from API to app controller

* Fix system test to edit posts

* Move article update from API to app controller

* Rewrite create article API using API key

* Add main_image and canonical_url to allowed creation params

* Rewrite update article API using API key

* Fix tests and have Comments API inherit from API
2019-05-16 12:26:24 -04:00
Mario See
7dd811a578 Utilize ERB template for GitHub Liquid tags (#2777) [ci skip] 2019-05-14 15:21:23 -04:00
Mario See
86d8128dd9 Utilize ERB template in CodepenTag (#2748) [ci skip] 2019-05-09 19:33:59 -04:00
Mario See
e0d4329089 Utilize ERB template in SoundcloudTag (#2752) [ci skip] 2019-05-09 16:17:03 -04:00
Mario See
84eb7ceb75 Utilize ERB template in Instagram liquid tag (#2749) [ci skip] 2019-05-09 13:20:22 -04:00
Mario See
20a50fb0f8 Utilize ERB template in Youtube/Vimeo liquid tag (#2728) [ci skip] 2019-05-09 12:44:00 -04:00
rhymes
e626002260 Add alternative texts to images (#2771) [ci skip] 2019-05-09 11:16:03 -04:00
Mario See
767029bc10 JS Fiddle Liquid tag render to utilize ActionController (#2746) [ci skip] 2019-05-08 13:05:07 -04:00
Mario See
68239c4cf8 Change Runkit liquid tag to utilize ActionController (#2723) 2019-05-07 16:44:20 -04:00
Mario See
b1f97a0657 Change Twitter liquid tag to utilize ActionController (#2721) [ci skip] 2019-05-07 16:40:50 -04:00
Anna Buianova
74d676c4c3 Remove unused code (#2567) [ci skip] 2019-04-26 12:16:16 -04:00
rhymes
8e6ca966ed Switch from chromedriver-helper to webdrivers (#2465) [ci skip] 2019-04-16 13:46:23 -04:00
Andy Zhao
53d3091f73 Add single article functionality to articles analytics (#2339)
* Add specs for single article functionality

* Add single article functionality

* Use article_id instead of single_article_id

* Add published: true when querying for one article

* Use article_id in specs oops
2019-04-08 19:57:13 -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
rhymes
5e9867ec56 Simplify AnalyticsService code (#2308)
* Add basic tests for Analytics service

* User/Organization are always required

* Add some data to the test

* Use queries and date times

* Fix AnalyticsService interface in the controller

* s/HTTP_API_KEY/api-key

* Defend against nils and support datetime objects

* Update app/services/analytics_service.rb

Co-Authored-By: rhymes <rhymesete@gmail.com>

* Use SQL sum, not Rails sum

* Group average_read_time

* Use SQL, not Rails

* Use ISO date

* Fix specs
2019-04-04 16:07:57 -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
Andy Zhao
3e89796d9d Add API Analytics Endpoints (#2293)
* Add API endpoints for analytics

* Remove comment and spacing

* Use proper time formatting

* Refactor and clean up some logic

* Add pro and org member traits

* Use shared examples for analytics API spec

* Add analytics authorization specs

* Remove accidental include Pundit

* Raise not_authorized for invalid requests

* Make attributes and time methods private

* Add custom UnauthorizedError

* Raise and use rescue_from to handle 4xx requests

* Enforce date parameters to follow a specific format

* Use current user to allow same origin requests

* Use custom headers and not params for token auth

* Default to current user for same origin requests

* Use correct boolean for choosing user

* Update tests to use request headers and add stricter tests
2019-04-04 10:52:45 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -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
Mac Siri
1137d6fba4 Improve specs (#1693)
* Lock erb_lint

* Refactor moderation spec

* Remove & replace RequestSpecHelper

* Update uid to sequence

* Lower the need for persistence in specs

* Update moderation spec

* Update shoulda-matchers

* Enable backgroundjobs and update commenct spec

* Fix fail specs

* Update comment's validations

* Remove redundent specs

* Actually turn off DJ

* Apply run_background_jobs_immediately

* Remove giveawy specs

* Create Identity spec
2019-02-04 15:56:00 -04:00
Andrew Bone
b56865915c Jsfiddle LiquidTag (#1509)
* Create jsfiddle_tag.rb

Add liquid tag for jsfiddle

* Create jsfiddle_tag-spec.rb

Add liquid tag for jsfiddle

* Update _editor_guide_text.html.erb

Add liquid tag for jsfiddle

* Updates for rubocop

* Edit boilerplate

Change some of the boiler plate code.

* rubocop compliance

* Fixed name

Fixed file name

* Fixed boiler plate

Changed codepen to jsfiddle

* Update guide text

Change the Guide Text to be jsfiddle specific.

Co-Authored-By: Link2Twenty <AndrewB05@gmail.com>

* Fixed typo in spec

Co-Authored-By: Link2Twenty <AndrewB05@gmail.com>

* Update Valid Link

* Update jsfiddle_tag.rb

* Add Approved html

* Remove double slash

* Revert change

* Fix XSS error

* Remove extra line

* Remove extra slash

* Remove extra slash

* Make DRY

* rubocop compliance

* Change test logic

* Revert test to Approvals

* Fix HTML approved
2019-01-17 15:44:01 -05:00