summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-03 13:42:17 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-03 13:42:17 +0300
commit8b76e30656954c2dd95121fff46c4bc6cc81bb74 (patch)
tree752789a7cbb9598616297099bd3070d522a10400
parent224fb5770ce71061861f5c2bddb01924d668a841 (diff)
downloadgitlab-ce-8b76e30656954c2dd95121fff46c4bc6cc81bb74.tar.gz
Spianch test for group dashboard
-rw-r--r--app/models/group.rb4
-rw-r--r--app/views/groups/show.html.haml8
-rw-r--r--app/views/snippets/show.html.haml23
-rw-r--r--features/dashboard/dashboard.feature5
-rw-r--r--features/group/group.feature9
-rw-r--r--features/steps/group/group.rb32
6 files changed, 68 insertions, 13 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 4328306602c..1bb805e8caf 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -22,6 +22,10 @@ class Group < ActiveRecord::Base
delegate :name, to: :owner, allow_nil: true, prefix: true
+ def self.search query
+ where("name like :query or code like :query", query: "%#{query}%")
+ end
+
def to_param
code
end
diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml
index 074288a9b65..cd86a01f276 100644
--- a/app/views/groups/show.html.haml
+++ b/app/views/groups/show.html.haml
@@ -1,8 +1,10 @@
.projects
.activities.span8
- .back_link
- = link_to dashboard_path do
- &larr; To dashboard
+ = link_to dashboard_path, class: 'btn very_small' do
+ &larr; To dashboard
+ &nbsp;
+ %span.cgray Events and projects are filtered in scope of group
+ %hr
= render 'shared/no_ssh'
- if @events.any?
.content_list= render @events
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index 4188a9f198c..1b8701e91ed 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -7,14 +7,17 @@
= link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right"
%br
-.file_holder
- .file_title
- %i.icon-file
- %strong= @snippet.file_name
- %span.options
- = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
- .file_content.code
- %div{class: current_user.dark_scheme ? "black" : ""}
- = raw @snippet.colorize(options: { linenos: 'True'})
+%div
+ .file_holder
+ .file_title
+ %i.icon-file
+ %strong= @snippet.file_name
+ %span.options
+ = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
+ .file_content.code
+ %div{class: current_user.dark_scheme ? "black" : ""}
+ = raw @snippet.colorize(options: { linenos: 'True'})
-= render "notes/notes_with_form", tid: @snippet.id, tt: "snippet"
+
+%div
+ = render "notes/notes_with_form", tid: @snippet.id, tt: "snippet"
diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature
index 40217a7d904..24296f46579 100644
--- a/features/dashboard/dashboard.feature
+++ b/features/dashboard/dashboard.feature
@@ -10,6 +10,11 @@ Feature: Dashboard
Then I should see "Shop" project link
Then I should see project "Shop" activity feed
+ Scenario: I should see groups list
+ Given I have group with projects
+ And I visit dashboard page
+ Then I should see groups list
+
Scenario: I should see last push widget
Then I should see last push widget
And I click "Create Merge Request" link
diff --git a/features/group/group.feature b/features/group/group.feature
new file mode 100644
index 00000000000..dbddb92ccce
--- /dev/null
+++ b/features/group/group.feature
@@ -0,0 +1,9 @@
+Feature: Groups
+ Background:
+ Given I sign in as a user
+ And I have group with projects
+
+ Scenario: I should see group dashboard list
+ When I visit group page
+ Then I should see projects list
+ And I should see projects activity feed
diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb
new file mode 100644
index 00000000000..798c62c3a11
--- /dev/null
+++ b/features/steps/group/group.rb
@@ -0,0 +1,32 @@
+class Groups < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+
+ When 'I visit group page' do
+ visit group_path(current_group)
+ end
+
+ Then 'I should see projects list' do
+ current_user.projects.each do |project|
+ page.should have_link project.name
+ end
+ end
+
+ And 'I have group with projects' do
+ @group = Factory :group
+ @project = Factory :project, group: @group
+ @event = Factory :closed_issue_event, project: @project
+
+ @project.add_access current_user, :admin
+ end
+
+ And 'I should see projects activity feed' do
+ page.should have_content 'closed issue'
+ end
+
+ protected
+
+ def current_group
+ @group ||= Group.first
+ end
+end