Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diaspora
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Milan
diaspora
Commits
41cfd36b
Commit
41cfd36b
authored
14 years ago
by
Raphael
Browse files
Options
Downloads
Patches
Plain Diff
Refactor user_spec a little
parent
fe1a6bce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/models/user_spec.rb
+8
-20
8 additions, 20 deletions
spec/models/user_spec.rb
with
8 additions
and
20 deletions
spec/models/user_spec.rb
+
8
−
20
View file @
41cfd36b
...
...
@@ -9,8 +9,6 @@ describe User do
let
(
:aspect
)
{
user
.
aspect
(
:name
=>
'heroes'
)
}
let
(
:user2
)
{
Factory
(
:user
)
}
let
(
:aspect2
)
{
user2
.
aspect
(
:name
=>
'stuff'
)
}
let
(
:user3
)
{
Factory
(
:user
)
}
let
(
:aspect3
)
{
user3
.
aspect
(
:name
=>
'stuff'
)
}
describe
"validation"
do
describe
"of associated person"
do
...
...
@@ -168,12 +166,7 @@ describe User do
end
end
context
'account removal'
do
before
do
friend_users
(
user
,
aspect
,
user2
,
aspect2
)
friend_users
(
user
,
aspect
,
user3
,
aspect3
)
end
describe
'account removal'
do
it
'should unfriend everyone'
do
user
.
should_receive
(
:unfriend_everyone
)
user
.
destroy
...
...
@@ -185,11 +178,8 @@ describe User do
end
it
'should remove all aspects'
do
aspects
=
user
.
aspects
aspects
.
count
.
should
>
0
user
.
destroy
aspects
.
reload
aspects
.
count
.
should
==
0
aspect
lambda
{
user
.
destroy
}.
should
change
{
user
.
aspects
.
reload
.
count
}.
by
(
-
1
)
end
describe
'#remove_person'
do
...
...
@@ -209,20 +199,18 @@ describe User do
end
describe
'#unfriend_everyone'
do
before
do
user3
.
delete
end
it
'should send retractions to remote poeple'
do
user2
.
delete
user
.
activate_friend
(
user2
.
person
,
aspect
)
user
.
should_receive
(
:unfriend
).
once
user
.
destroy
end
it
'should unfriend local people'
do
user2
.
friends
.
count
.
should
be
1
user
.
destroy
user2
.
reload
user2
.
friends
.
count
.
should
be
0
friend_users
(
user
,
aspect
,
user2
,
aspect2
)
lambda
{
user
.
destroy
}.
should
change
{
user2
.
reload
.
friends
.
count
}.
by
(
-
1
)
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment