Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
parlote-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
parlote-facil
Validations
546f9096
Valider
546f9096
rédigé
il y a 8 ans
par
Steffen van Bergerem
Validation de
Benjamin Neff
il y a 8 ans
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fix 500 in html requests for post interactions
closes #7085
parent
e54077c8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
Changelog.md
+1
-0
1 ajout, 0 suppression
Changelog.md
app/controllers/posts_controller.rb
+7
-2
7 ajouts, 2 suppressions
app/controllers/posts_controller.rb
spec/controllers/posts_controller_spec.rb
+32
-0
32 ajouts, 0 suppression
spec/controllers/posts_controller_spec.rb
avec
40 ajouts
et
2 suppressions
Changelog.md
+
1
−
0
Voir le fichier @
546f9096
...
...
@@ -15,6 +15,7 @@
*
More buttons in mobile streams are fixed
[
#7036
](
https://github.com/diaspora/diaspora/pull/7036
)
*
Fixed missing sidebar background in the contacts tab
[
#7064
](
https://github.com/diaspora/diaspora/pull/7064
)
*
Fix tags URLs in hovercards
[
#7075
](
https://github.com/diaspora/diaspora/pull/7075
)
*
Fix 500 in html requests for post interactions
[
#7085
](
https://github.com/diaspora/diaspora/pull/7085
)
## Features
*
Deleted comments will be removed when loading more comments
[
#7045
](
https://github.com/diaspora/diaspora/pull/7045
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/controllers/posts_controller.rb
+
7
−
2
Voir le fichier @
546f9096
...
...
@@ -41,8 +41,13 @@ class PostsController < ApplicationController
end
def
interactions
post
=
post_service
.
find!
(
params
[
:id
])
respond_with
PostInteractionPresenter
.
new
(
post
,
current_user
)
respond_to
do
|
format
|
format
.
json
{
post
=
post_service
.
find!
(
params
[
:id
])
render
json:
PostInteractionPresenter
.
new
(
post
,
current_user
)
}
format
.
any
{
render
nothing:
true
,
status:
406
}
end
end
def
destroy
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
spec/controllers/posts_controller_spec.rb
+
32
−
0
Voir le fichier @
546f9096
...
...
@@ -136,6 +136,38 @@ describe PostsController, type: :controller do
end
end
describe
"#interactions"
do
context
"user not signed in"
do
it
"returns a 401 for private posts and format json"
do
get
:interactions
,
id:
post
.
id
,
format: :json
expect
(
response
.
status
).
to
eq
(
401
)
expect
(
JSON
.
parse
(
response
.
body
)[
"error"
]).
to
eq
(
I18n
.
t
(
"devise.failure.unauthenticated"
))
end
it
"returns a 406 for private posts and format html"
do
get
:interactions
,
id:
post
.
id
expect
(
response
.
status
).
to
eq
(
406
)
end
end
context
"user signed in"
do
before
do
sign_in
alice
end
it
"shows interactions of a post as json"
do
get
:interactions
,
id:
post
.
id
,
format: :json
expect
(
response
.
body
).
to
eq
(
PostInteractionPresenter
.
new
(
post
,
alice
).
to_json
)
end
it
"returns a 406 for format html"
do
sign_in
alice
get
:interactions
,
id:
post
.
id
expect
(
response
.
status
).
to
eq
(
406
)
end
end
end
describe
"#destroy"
do
context
"own post"
do
before
do
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter