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
605b418d
Valider
605b418d
rédigé
12 years ago
par
Steven Hancock
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Reshares delegate nsfw to the root post
fixes #3120
parent
00123c0a
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
app/models/reshare.rb
+4
-0
4 ajouts, 0 suppression
app/models/reshare.rb
features/not_safe_for_work.feature
+15
-0
15 ajouts, 0 suppression
features/not_safe_for_work.feature
spec/models/reshare_spec.rb
+14
-0
14 ajouts, 0 suppression
spec/models/reshare_spec.rb
avec
33 ajouts
et
0 suppression
app/models/reshare.rb
+
4
−
0
Voir le fichier @
605b418d
...
@@ -61,6 +61,10 @@ class Reshare < Post
...
@@ -61,6 +61,10 @@ class Reshare < Post
Notifications
::
Reshared
if
root
.
author
==
user
.
person
Notifications
::
Reshared
if
root
.
author
==
user
.
person
end
end
def
nsfw
root
.
nsfw
end
private
private
def
after_parse
def
after_parse
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
features/not_safe_for_work.feature
+
15
−
0
Voir le fichier @
605b418d
...
@@ -41,3 +41,18 @@ Scenario: Toggling nsfw state
...
@@ -41,3 +41,18 @@ Scenario: Toggling nsfw state
When
I toggle nsfw posts
When
I toggle nsfw posts
Then
I should not see
"I love 0bj3ction4bl3 c0nt3nt!"
Then
I should not see
"I love 0bj3ction4bl3 c0nt3nt!"
And
I should not see
"Sexy Senators Gone Wild!"
And
I should not see
"Sexy Senators Gone Wild!"
Scenario
:
Resharing an nsfw post
Given
a nsfw user with email
"tommy@pr0nking.com"
And
a user with email
"laura@officeworkers.com"
And
a user with email
"laura@officeworkers.com"
is connected with
"tommy@pr0nking.com"
And
"tommy@pr0nking.com"
has a public post with text
"Sexy Senators Gone Wild!"
And
I sign in as
"laura@officeworkers.com"
And
I toggle nsfw posts
And
I preemptively confirm the alert
And
I follow
"Reshare"
And
I wait for the ajax to finish
And
I follow
"Stream"
And
I wait for the ajax to finish
Then
I should have 2 nsfw posts
And
I should not see
"Sexy Senators Gone Wild!"
Ce diff est replié.
Cliquez pour l'agrandir.
spec/models/reshare_spec.rb
+
14
−
0
Voir le fichier @
605b418d
...
@@ -53,6 +53,20 @@ describe Reshare do
...
@@ -53,6 +53,20 @@ describe Reshare do
end
end
end
end
describe
'#nsfw'
do
before
do
sfw
=
Factory
(
:status_message
,
:author
=>
alice
.
person
,
:public
=>
true
)
nsfw
=
Factory
(
:status_message
,
:author
=>
alice
.
person
,
:public
=>
true
,
:text
=>
"This is #nsfw"
)
@sfw_reshare
=
Factory
(
:reshare
,
:root
=>
sfw
)
@nsfw_reshare
=
Factory
(
:reshare
,
:root
=>
nsfw
)
end
it
'deletates #nsfw to the root post'
do
@sfw_reshare
.
nsfw
.
should_not
be_true
@nsfw_reshare
.
nsfw
.
should
be_true
end
end
describe
'#notification_type'
do
describe
'#notification_type'
do
before
do
before
do
sm
=
Factory
(
:status_message
,
:author
=>
alice
.
person
,
:public
=>
true
)
sm
=
Factory
(
:status_message
,
:author
=>
alice
.
person
,
:public
=>
true
)
...
...
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