Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e1d307bf
Commit
e1d307bf
authored
Jul 17, 2014
by
Ciro Santilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move destroy user feature to spec.
parent
15914676
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
features/project/star.feature
features/project/star.feature
+0
-10
features/steps/shared/user.rb
features/steps/shared/user.rb
+0
-5
spec/models/project_spec.rb
spec/models/project_spec.rb
+14
-3
No files found.
features/project/star.feature
View file @
e1d307bf
...
@@ -36,13 +36,3 @@ Feature: Project Star
...
@@ -36,13 +36,3 @@ Feature: Project Star
And
I visit project
"Community"
page
And
I visit project
"Community"
page
When
I click on the star toggle button
When
I click on the star toggle button
Then
The project has 2 stars
Then
The project has 2 stars
@javascript
Scenario
:
If an user deletes his account his stars are destroyed
Given
I sign in as
"John Doe"
And
public project
"Community"
And
I visit project
"Community"
page
And
I click on the star toggle button
And
I delete my account
When
I visit project
"Community"
page
Then
The project has 0 stars
features/steps/shared/user.rb
View file @
e1d307bf
...
@@ -9,11 +9,6 @@ module SharedUser
...
@@ -9,11 +9,6 @@ module SharedUser
user_exists
(
"Mary Jane"
,
{
username:
"mary_jane"
})
user_exists
(
"Mary Jane"
,
{
username:
"mary_jane"
})
end
end
step
"I delete my account"
do
visit
profile_account_path
click_link
"Delete account"
end
protected
protected
def
user_exists
(
name
,
options
=
{})
def
user_exists
(
name
,
options
=
{})
...
...
spec/models/project_spec.rb
View file @
e1d307bf
...
@@ -241,8 +241,8 @@ describe Project do
...
@@ -241,8 +241,8 @@ describe Project do
it
{
project
.
open_branches
.
map
(
&
:name
).
should_not
include
(
'master'
)
}
it
{
project
.
open_branches
.
map
(
&
:name
).
should_not
include
(
'master'
)
}
end
end
describe
"#star_count"
do
describe
'#star_count'
do
it
"counts stars from multiple users"
do
it
'counts stars from multiple users'
do
user1
=
create
:user
user1
=
create
:user
user2
=
create
:user
user2
=
create
:user
project
=
create
:project
,
:public
project
=
create
:project
,
:public
...
@@ -265,7 +265,7 @@ describe Project do
...
@@ -265,7 +265,7 @@ describe Project do
expect
(
project
.
reload
.
star_count
).
to
eq
(
0
)
expect
(
project
.
reload
.
star_count
).
to
eq
(
0
)
end
end
it
"counts stars on the right project"
do
it
'counts stars on the right project'
do
user
=
create
:user
user
=
create
:user
project1
=
create
:project
,
:public
project1
=
create
:project
,
:public
project2
=
create
:project
,
:public
project2
=
create
:project
,
:public
...
@@ -297,5 +297,16 @@ describe Project do
...
@@ -297,5 +297,16 @@ describe Project do
expect
(
project1
.
star_count
).
to
eq
(
0
)
expect
(
project1
.
star_count
).
to
eq
(
0
)
expect
(
project2
.
star_count
).
to
eq
(
0
)
expect
(
project2
.
star_count
).
to
eq
(
0
)
end
end
it
'is decremented when an upvoter account is deleted'
do
user
=
create
:user
project
=
create
:project
,
:public
user
.
toggle_star
(
project
)
project
.
reload
expect
(
project
.
star_count
).
to
eq
(
1
)
user
.
destroy
project
.
reload
expect
(
project
.
star_count
).
to
eq
(
0
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment