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
.projects
.activities.span8
- .back_link
- = link_to dashboard_path do
- ← To dashboard
+ = link_to dashboard_path, class: 'btn very_small' do
+ ← To dashboard
+
+ %span.cgray Events and projects are filtered in scope of group
+ %hr
= render 'shared/no_ssh'
- if @events.any?
.content_list= render @events
= 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"
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
--- /dev/null
+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
--- /dev/null
+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