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
dc2414c174
Add tests to PodcastEpisodesController ( #2297 )
...
* Add tests for existing API PodcastEpisodesController
* Generate only index route
There's no need to generate all routes if they are not implemented
2019-04-03 09:57:48 -04:00
rhymes
c99fb27451
Add published in the SQL query to retrieve article ( #2248 )
...
Since we're already asking the DB to retrieve an article, we can directly ask it to filter out published articles without checking at runtime.
2019-04-01 06:24:17 -04:00
rhymes
54ccef4766
Fix error with articles API and unknown username ( #2247 )
...
Currently the articles API breaks the server when called with an unknown username. It should return nothing like when called with an unknown tag.
2019-03-31 10:47:48 -04:00
Mac Siri
73127aca01
Remove controller specs ( #2224 )
...
* Create more request specs
* Update wording
* Update guard to work with requests
* Fix broken spec
* Remove rails-controller-testing gem
* Move article_specs
* Move last controller spec out
* Remove controller spec config
* Fix broken spec
* Remove all use of render_template
* Refactor spec
* Tweak User#remember_me
* Create ArticleAnalyticFetcher spec
* Undo User#remember_me
* Use srand in rspec
* Create FeedbackMessagesHelper spec
* Add DigestMailer spec
* Fix broken test
2019-03-29 19:05:02 -04:00
Abraham Williams
9cb40e546b
Enables Rails cops ( #2186 )
...
* Enable Rails cops
* Fix Rails/DynamicFindBy
* Fix Rails/HttpStatus
* Fix Rails/Blank
* Fix Rails/RequestReferer
* Fix Rails/ActiveRecordAliases
* Fix Rails/FindBy
* Fix Rails/Presence
* Fix Rails/Delegate
* Fix Rails/Validation
* Fix Rails/PluralizationGrammar
* Fix Rails/Present
* Fix Rails/Output
* Fix Rails/Blank
* Fix Rails/FilePath
* Fix Rails/InverseOf
* Fix Rails/LexicallyScopedActionFilter
* Add Rails/OutputSafety to TODO
* Add Rails/HasManyOrHasOneDependent to TODO
* Add Rails/SkipsModelValidations to TODO
2019-03-25 09:25:55 -04:00
Mac Siri
2e647cedb4
Add more test coverage ( #1829 )
...
* Create github repos request spec
* Create article_mutes_spec.rb
* Create moderation_service_spec.rb
* Create push notification subscriptions spec
* Add PodcastEpisodeDecorator specs
* Remove randomness in test
* Create specs for ArticleWithVideoCreationService
* Update spec/decorators/podcast_episode_decorator_spec.rb
Co-Authored-By: maestromac <krairit.siri@gmail.com>
2019-02-22 09:16:57 -08:00