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
Kazuhiko Shiozaki
gitlab-ce
Commits
f0644590
Commit
f0644590
authored
Nov 28, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2107 from AlexDenisov/projects_count_at_dashboard
Projects count at dashboard
parents
c873cf81
34c2d8e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
app/models/project.rb
app/models/project.rb
+1
-0
app/views/dashboard/_groups.html.haml
app/views/dashboard/_groups.html.haml
+1
-1
features/dashboard/dashboard.feature
features/dashboard/dashboard.feature
+6
-0
features/steps/dashboard/dashboard.rb
features/steps/dashboard/dashboard.rb
+10
-0
No files found.
app/models/project.rb
View file @
f0644590
...
@@ -73,6 +73,7 @@ class Project < ActiveRecord::Base
...
@@ -73,6 +73,7 @@ class Project < ActiveRecord::Base
scope
:public_only
,
where
(
private_flag:
false
)
scope
:public_only
,
where
(
private_flag:
false
)
scope
:without_user
,
->
(
user
)
{
where
(
"id NOT IN (:ids)"
,
ids:
user
.
projects
.
map
(
&
:id
)
)
}
scope
:without_user
,
->
(
user
)
{
where
(
"id NOT IN (:ids)"
,
ids:
user
.
projects
.
map
(
&
:id
)
)
}
scope
:not_in_group
,
->
(
group
)
{
where
(
"id NOT IN (:ids)"
,
ids:
group
.
project_ids
)
}
scope
:not_in_group
,
->
(
group
)
{
where
(
"id NOT IN (:ids)"
,
ids:
group
.
project_ids
)
}
scope
:authorized_for
,
->
(
user
)
{
joins
(
:users_projects
)
{
where
(
user_id:
user
.
id
)
}
}
class
<<
self
class
<<
self
def
active
def
active
...
...
app/views/dashboard/_groups.html.haml
View file @
f0644590
...
@@ -17,4 +17,4 @@
...
@@ -17,4 +17,4 @@
→
→
%span
.last_activity
%span
.last_activity
%strong
Projects:
%strong
Projects:
%span
=
group
.
projects
.
count
%span
=
group
.
projects
.
authorized_for
(
current_user
).
count
features/dashboard/dashboard.feature
View file @
f0644590
...
@@ -15,6 +15,12 @@ Feature: Dashboard
...
@@ -15,6 +15,12 @@ Feature: Dashboard
And
I visit dashboard page
And
I visit dashboard page
Then
I should see groups list
Then
I should see groups list
Scenario
:
I
should see correct projects count
Given
I have group with projects
And
group has a projects that does not belongs to me
When
I visit dashboard page
Then
I should see 1 project at group list
Scenario
:
I
should see last push widget
Scenario
:
I
should see last push widget
Then
I should see last push widget
Then
I should see last push widget
And
I click
"Create Merge Request"
link
And
I click
"Create Merge Request"
link
...
...
features/steps/dashboard/dashboard.rb
View file @
f0644590
...
@@ -103,4 +103,14 @@ class Dashboard < Spinach::FeatureSteps
...
@@ -103,4 +103,14 @@ class Dashboard < Spinach::FeatureSteps
page
.
should
have_link
group
.
name
page
.
should
have_link
group
.
name
end
end
end
end
And
'group has a projects that does not belongs to me'
do
@forbidden_project1
=
create
(
:project
,
group:
@group
)
@forbidden_project2
=
create
(
:project
,
group:
@group
)
end
Then
'I should see 1 project at group list'
do
page
.
find
(
'span.last_activity/span'
).
should
have_content
(
'1'
)
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