Commit graph

5 commits

Author SHA1 Message Date
Anna Buianova
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00
rhymes
e48c9668fd Fix access token revoking (#3131)
* Move API secret ID inside the form

* Add tests for unknown and unauthorized API secrets

* Use Rails conventions a little better
2019-06-11 15:53:58 -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
Tim Lange
3494264404 Enabled rubocop/lint (#2130)
* WIP: Enabled rubocop/lint

* FIX: Fixed failing test

* FIX: Small change to return

* FIX: Changed indent
2019-03-21 10:53:44 -04:00
Timothy Ng
84bd3a69d7 ApiSecret model for Developer API (#1369)
* Add ApiSecret model scaffold

* Add relationships between ApiSecret, User, Organization

* Add placeholder template to account tab

* Add description column to ApiSecrets

* Add very basic access token generation

* Add basic access token deletion

* Show access token on success flash

* Add placeholder message when user has no secrets

* Use cta style on token generation button

* Add presence validation for ApiSecret description

* Add ApiSecrets factory

* Add pundit policy for ApiSecret

* Nest form field within api_secret hash to allow rails strong params

* Use pundit to authorize ApiSecretController actions

* Add error message flash for ApiSecretsController actions

* Add specs for ApiSecretsController

* Add length validation to api secret description

* Flash model error instead of generic message on save failure

* Truncate ApiSecret factory objects descriptions to prevent validation error

* Remove length restriction on ApiSecret.description

* Use darker font color for token creation date

* Consolidate ApiSecret migrations
2019-01-08 12:30:54 -05:00