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 conteneurs
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
6af21e00
Valider
6af21e00
rédigé
14 years ago
par
MrZYX
Parcourir les fichiers
Options
Téléchargements
Plain Diff
Merge branch '913-new-bug' of
https://github.com/kiranh/diaspora
into pull
parents
fb6e32e3
7c3a1730
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/user.rb
+8
-1
8 ajouts, 1 suppression
app/models/user.rb
features/closes_account.feature
+21
-2
21 ajouts, 2 suppressions
features/closes_account.feature
spec/models/user_spec.rb
+16
-0
16 ajouts, 0 suppression
spec/models/user_spec.rb
avec
45 ajouts
et
3 suppressions
app/models/user.rb
+
8
−
1
Voir le fichier @
6af21e00
...
...
@@ -39,7 +39,7 @@ class User < ActiveRecord::Base
has_many
:services
has_many
:user_preferences
before_destroy
:disconnect_everyone
,
:remove_person
before_destroy
:disconnect_everyone
,
:remove_mentions
,
:remove_person
before_save
do
person
.
save
if
person
&&
person
.
changed?
end
...
...
@@ -313,4 +313,11 @@ class User < ActiveRecord::Base
}
self
.
aspects
.
delete_all
end
def
remove_mentions
Mention
.
where
(
:person_id
=>
self
.
person
.
id
).
each
do
|
mentioned_person
|
mentioned_person
.
delete
end
end
end
Ce diff est replié.
Cliquez pour l'agrandir.
features/closes_account.feature
+
21
−
2
Voir le fichier @
6af21e00
...
...
@@ -7,13 +7,32 @@ Feature: Close Account
Scenario
:
user closes account
Given
I am signed in
When
I click on my name in the header
And
I follow
"account settings"
And
I follow
"account settings"
And
I click ok in the confirm dialog to appear next
And
I follow
"Close Account"
Then
I should be on the home page
When
I go to the new user session page
And
I try to sign in
Then
I should be on the new user session page
When
I wait for the ajax to finish
Then
I should see
"Invalid email or password."
Scenario
:
post display should not throw error when mention is removed for the user whose account is closed
Given
a user named
"Bob Jones"
with email
"bob@bob.bob"
And
a user named
"Alice Smith"
with email
"alice@alice.alice"
And
a user with email
"bob@bob.bob"
is connected with
"alice@alice.alice"
When
I sign in as
"alice@alice.alice"
And
I am on the home page
And
I expand the publisher
And
I fill in
"status_message_fake_message"
with
"Hi, @{Bob Jones; bob_jones@example.org} long time no see"
And
I press
"Share"
And
I log out
Then
I sign in as
"bob@bob.bob"
When
I click on my name in the header
And
I follow
"account settings"
And
I click ok in the confirm dialog to appear next
And
I follow
"Close Account"
Then
I sign in as
"alice@alice.alice"
And
I am on the home page
Then
I should see
"Hi, Bob Jones long time no see"
Ce diff est replié.
Cliquez pour l'agrandir.
spec/models/user_spec.rb
+
16
−
0
Voir le fichier @
6af21e00
...
...
@@ -381,6 +381,11 @@ describe User do
}.
should
change
{
alice
.
invitations_to_me
(
true
).
count
}.
by
(
-
1
)
end
it
'should remove mentions'
do
alice
.
should_receive
(
:remove_mentions
)
alice
.
destroy
end
it
'should remove person'
do
alice
.
should_receive
(
:remove_person
)
alice
.
destroy
...
...
@@ -421,6 +426,17 @@ describe User do
end
end
describe
'#remove_mentions'
do
it
'should remove the mentions'
do
person
=
alice
.
person
sm
=
Factory
(
:status_message
)
mention
=
Mention
.
create
(
:person
=>
person
,
:post
=>
sm
)
alice
.
reload
alice
.
destroy
proc
{
mention
.
reload
}.
should
raise_error
ActiveRecord
::
RecordNotFound
end
end
describe
'#disconnect_everyone'
do
it
'has no error on a local friend who has deleted his account'
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