Commit 1cfc2b6fc7e49f8281a055b340509863c7706ada
Exists in
master
and in
4 other branches
Merge branch 'Undev-team-and-group-descriptions'
Showing
27 changed files
with
149 additions
and
48 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/common.scss
app/models/group.rb
@@ -2,13 +2,14 @@ | @@ -2,13 +2,14 @@ | ||
2 | # | 2 | # |
3 | # Table name: namespaces | 3 | # Table name: namespaces |
4 | # | 4 | # |
5 | -# id :integer not null, primary key | ||
6 | -# name :string(255) not null | ||
7 | -# path :string(255) not null | ||
8 | -# owner_id :integer not null | ||
9 | -# created_at :datetime not null | ||
10 | -# updated_at :datetime not null | ||
11 | -# type :string(255) | 5 | +# id :integer not null, primary key |
6 | +# name :string(255) not null | ||
7 | +# description :string(255) not null | ||
8 | +# path :string(255) not null | ||
9 | +# owner_id :integer not null | ||
10 | +# created_at :datetime not null | ||
11 | +# updated_at :datetime not null | ||
12 | +# type :string(255) | ||
12 | # | 13 | # |
13 | 14 | ||
14 | class Group < Namespace | 15 | class Group < Namespace |
app/models/namespace.rb
@@ -2,17 +2,18 @@ | @@ -2,17 +2,18 @@ | ||
2 | # | 2 | # |
3 | # Table name: namespaces | 3 | # Table name: namespaces |
4 | # | 4 | # |
5 | -# id :integer not null, primary key | ||
6 | -# name :string(255) not null | ||
7 | -# path :string(255) not null | ||
8 | -# owner_id :integer not null | ||
9 | -# created_at :datetime not null | ||
10 | -# updated_at :datetime not null | ||
11 | -# type :string(255) | 5 | +# id :integer not null, primary key |
6 | +# name :string(255) not null | ||
7 | +# description :string(255) not null | ||
8 | +# path :string(255) not null | ||
9 | +# owner_id :integer not null | ||
10 | +# created_at :datetime not null | ||
11 | +# updated_at :datetime not null | ||
12 | +# type :string(255) | ||
12 | # | 13 | # |
13 | 14 | ||
14 | class Namespace < ActiveRecord::Base | 15 | class Namespace < ActiveRecord::Base |
15 | - attr_accessible :name, :path | 16 | + attr_accessible :name, :description, :path |
16 | 17 | ||
17 | has_many :projects, dependent: :destroy | 18 | has_many :projects, dependent: :destroy |
18 | belongs_to :owner, class_name: "User" | 19 | belongs_to :owner, class_name: "User" |
@@ -22,7 +23,7 @@ class Namespace < ActiveRecord::Base | @@ -22,7 +23,7 @@ class Namespace < ActiveRecord::Base | ||
22 | length: { within: 0..255 }, | 23 | length: { within: 0..255 }, |
23 | format: { with: Gitlab::Regex.name_regex, | 24 | format: { with: Gitlab::Regex.name_regex, |
24 | message: "only letters, digits, spaces & '_' '-' '.' allowed." } | 25 | message: "only letters, digits, spaces & '_' '-' '.' allowed." } |
25 | - | 26 | + validates :description, length: { within: 0..255 } |
26 | validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, | 27 | validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, |
27 | format: { with: Gitlab::Regex.path_regex, | 28 | format: { with: Gitlab::Regex.path_regex, |
28 | message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } | 29 | message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } |
app/models/user_team.rb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | # | 11 | # |
12 | 12 | ||
13 | class UserTeam < ActiveRecord::Base | 13 | class UserTeam < ActiveRecord::Base |
14 | - attr_accessible :name, :owner_id, :path | 14 | + attr_accessible :name, :description, :owner_id, :path |
15 | 15 | ||
16 | belongs_to :owner, class_name: User | 16 | belongs_to :owner, class_name: User |
17 | 17 | ||
@@ -26,6 +26,7 @@ class UserTeam < ActiveRecord::Base | @@ -26,6 +26,7 @@ class UserTeam < ActiveRecord::Base | ||
26 | length: { within: 0..255 }, | 26 | length: { within: 0..255 }, |
27 | format: { with: Gitlab::Regex.name_regex, | 27 | format: { with: Gitlab::Regex.name_regex, |
28 | message: "only letters, digits, spaces & '_' '-' '.' allowed." } | 28 | message: "only letters, digits, spaces & '_' '-' '.' allowed." } |
29 | + validates :description, length: { within: 0..255 } | ||
29 | validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, | 30 | validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, |
30 | format: { with: Gitlab::Regex.path_regex, | 31 | format: { with: Gitlab::Regex.path_regex, |
31 | message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } | 32 | message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } |
app/views/admin/groups/edit.html.haml
1 | -%h3.page_title Rename Group | 1 | +%h3.page_title Edit Group |
2 | %hr | 2 | %hr |
3 | = form_for [:admin, @group] do |f| | 3 | = form_for [:admin, @group] do |f| |
4 | - if @group.errors.any? | 4 | - if @group.errors.any? |
@@ -10,7 +10,10 @@ | @@ -10,7 +10,10 @@ | ||
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Example Group", class: "xxlarge" | 11 | = f.text_field :name, placeholder: "Example Group", class: "xxlarge" |
12 | 12 | ||
13 | - | 13 | + .clearfix.group-description-holder |
14 | + = f.label :description, "Details" | ||
15 | + .input | ||
16 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
14 | 17 | ||
15 | .clearfix.group_name_holder | 18 | .clearfix.group_name_holder |
16 | = f.label :path do | 19 | = f.label :path do |
@@ -24,5 +27,5 @@ | @@ -24,5 +27,5 @@ | ||
24 | %li It will change the git path to repositories under this group. | 27 | %li It will change the git path to repositories under this group. |
25 | 28 | ||
26 | .form-actions | 29 | .form-actions |
27 | - = f.submit 'Rename group', class: "btn btn-remove" | 30 | + = f.submit 'Edit group', class: "btn btn-remove" |
28 | = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" | 31 | = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" |
app/views/admin/groups/index.html.haml
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
17 | Name | 17 | Name |
18 | %i.icon-sort-down | 18 | %i.icon-sort-down |
19 | %th Path | 19 | %th Path |
20 | + %th Description | ||
20 | %th Projects | 21 | %th Projects |
21 | %th Owner | 22 | %th Owner |
22 | %th.cred Danger Zone! | 23 | %th.cred Danger Zone! |
@@ -25,11 +26,12 @@ | @@ -25,11 +26,12 @@ | ||
25 | %tr | 26 | %tr |
26 | %td | 27 | %td |
27 | %strong= link_to group.name, [:admin, group] | 28 | %strong= link_to group.name, [:admin, group] |
29 | + %td= group.description | ||
28 | %td= group.path | 30 | %td= group.path |
29 | %td= group.projects.count | 31 | %td= group.projects.count |
30 | %td | 32 | %td |
31 | = link_to group.owner_name, admin_user_path(group.owner) | 33 | = link_to group.owner_name, admin_user_path(group.owner) |
32 | %td.bgred | 34 | %td.bgred |
33 | - = link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small" | 35 | + = link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small" |
34 | = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" | 36 | = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" |
35 | = paginate @groups, theme: "admin" | 37 | = paginate @groups, theme: "admin" |
app/views/admin/groups/new.html.haml
@@ -9,8 +9,14 @@ | @@ -9,8 +9,14 @@ | ||
9 | Group name is | 9 | Group name is |
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" | 11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" |
12 | - | ||
13 | - = f.submit 'Create group', class: "btn btn-primary" | 12 | + .clearfix.group-description-holder |
13 | + = f.label :description, "Details" | ||
14 | + .input | ||
15 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
16 | + | ||
17 | + .form-actions | ||
18 | + = f.submit 'Create group', class: "btn btn-primary" | ||
19 | + | ||
14 | %hr | 20 | %hr |
15 | .padded | 21 | .padded |
16 | %ul | 22 | %ul |
app/views/admin/groups/show.html.haml
@@ -16,7 +16,13 @@ | @@ -16,7 +16,13 @@ | ||
16 | | 16 | |
17 | = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do | 17 | = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do |
18 | %i.icon-edit | 18 | %i.icon-edit |
19 | - Rename | 19 | + Edit |
20 | + %tr | ||
21 | + %td | ||
22 | + %b | ||
23 | + Description: | ||
24 | + %td | ||
25 | + = @group.description | ||
20 | %tr | 26 | %tr |
21 | %td | 27 | %td |
22 | %b | 28 | %b |
app/views/admin/teams/edit.html.haml
1 | -%h3.page_title Rename Team | 1 | +%h3.page_title Edit Team |
2 | %hr | 2 | %hr |
3 | = form_for @team, url: admin_team_path(@team), method: :put do |f| | 3 | = form_for @team, url: admin_team_path(@team), method: :put do |f| |
4 | - if @team.errors.any? | 4 | - if @team.errors.any? |
@@ -10,6 +10,11 @@ | @@ -10,6 +10,11 @@ | ||
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Example Team", class: "xxlarge" | 11 | = f.text_field :name, placeholder: "Example Team", class: "xxlarge" |
12 | 12 | ||
13 | + .clearfix.team-description-holder | ||
14 | + = f.label :description, "Details" | ||
15 | + .input | ||
16 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
17 | + | ||
13 | .clearfix.team_name_holder | 18 | .clearfix.team_name_holder |
14 | = f.label :path do | 19 | = f.label :path do |
15 | %span.cred Team path is | 20 | %span.cred Team path is |
@@ -19,5 +24,5 @@ | @@ -19,5 +24,5 @@ | ||
19 | %li It will change web url for access team and team projects. | 24 | %li It will change web url for access team and team projects. |
20 | 25 | ||
21 | .form-actions | 26 | .form-actions |
22 | - = f.submit 'Rename team', class: "btn btn-remove" | 27 | + = f.submit 'Edit team', class: "btn btn-remove" |
23 | = link_to 'Cancel', admin_teams_path, class: "btn btn-cancel" | 28 | = link_to 'Cancel', admin_teams_path, class: "btn btn-cancel" |
app/views/admin/teams/index.html.haml
@@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
16 | %th | 16 | %th |
17 | Name | 17 | Name |
18 | %i.icon-sort-down | 18 | %i.icon-sort-down |
19 | + %th Description | ||
19 | %th Path | 20 | %th Path |
20 | %th Projects | 21 | %th Projects |
21 | %th Members | 22 | %th Members |
@@ -26,13 +27,14 @@ | @@ -26,13 +27,14 @@ | ||
26 | %tr | 27 | %tr |
27 | %td | 28 | %td |
28 | %strong= link_to team.name, admin_team_path(team) | 29 | %strong= link_to team.name, admin_team_path(team) |
30 | + %td= team.description | ||
29 | %td= team.path | 31 | %td= team.path |
30 | %td= team.projects.count | 32 | %td= team.projects.count |
31 | %td= team.members.count | 33 | %td= team.members.count |
32 | %td | 34 | %td |
33 | = link_to team.owner.name, admin_user_path(team.owner) | 35 | = link_to team.owner.name, admin_user_path(team.owner) |
34 | %td.bgred | 36 | %td.bgred |
35 | - = link_to 'Rename', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small" | 37 | + = link_to 'Edit', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small" |
36 | = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" | 38 | = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" |
37 | 39 | ||
38 | = paginate @teams, theme: "admin" | 40 | = paginate @teams, theme: "admin" |
app/views/admin/teams/new.html.haml
@@ -9,8 +9,15 @@ | @@ -9,8 +9,15 @@ | ||
9 | Team name is | 9 | Team name is |
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" | 11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" |
12 | - | ||
13 | - = f.submit 'Create team', class: "btn btn-primary" | 12 | + |
13 | + .clearfix.team-description-holder | ||
14 | + = f.label :description, "Details" | ||
15 | + .input | ||
16 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
17 | + | ||
18 | + .form-actions | ||
19 | + = f.submit 'Create team', class: "btn btn-primary" | ||
20 | + | ||
14 | %hr | 21 | %hr |
15 | .padded | 22 | .padded |
16 | %ul | 23 | %ul |
app/views/admin/teams/show.html.haml
@@ -16,7 +16,13 @@ | @@ -16,7 +16,13 @@ | ||
16 | | 16 | |
17 | = link_to edit_admin_team_path(@team), class: "btn btn-small pull-right" do | 17 | = link_to edit_admin_team_path(@team), class: "btn btn-small pull-right" do |
18 | %i.icon-edit | 18 | %i.icon-edit |
19 | - Rename | 19 | + Edit |
20 | + %tr | ||
21 | + %td | ||
22 | + %b | ||
23 | + Description: | ||
24 | + %td | ||
25 | + = @team.description | ||
20 | %tr | 26 | %tr |
21 | %td | 27 | %td |
22 | %b | 28 | %b |
app/views/groups/edit.html.haml
@@ -9,8 +9,15 @@ | @@ -9,8 +9,15 @@ | ||
9 | Group name is | 9 | Group name is |
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" | 11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" |
12 | - | ||
13 | - = f.submit 'Save group', class: "btn btn-save" | 12 | + |
13 | + .clearfix.group-description-holder | ||
14 | + = f.label :description, "Details" | ||
15 | + .input | ||
16 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
17 | + | ||
18 | + .form-actions | ||
19 | + = f.submit 'Save group', class: "btn btn-save" | ||
20 | + | ||
14 | %hr | 21 | %hr |
15 | 22 | ||
16 | 23 |
app/views/groups/new.html.haml
@@ -9,9 +9,16 @@ | @@ -9,9 +9,16 @@ | ||
9 | Group name is | 9 | Group name is |
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" | 11 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" |
12 | - | ||
13 | - = f.submit 'Create group', class: "btn btn-create" | ||
14 | - %hr | 12 | + |
13 | + .clearfix.group-description-holder | ||
14 | + = f.label :description, "Details" | ||
15 | + .input | ||
16 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
17 | + | ||
18 | + .form-actions | ||
19 | + = f.submit 'Create group', class: "btn btn-create" | ||
20 | + | ||
21 | + | ||
15 | .padded | 22 | .padded |
16 | %ul | 23 | %ul |
17 | %li Group is kind of directory for several projects | 24 | %li Group is kind of directory for several projects |
app/views/groups/show.html.haml
@@ -12,6 +12,9 @@ | @@ -12,6 +12,9 @@ | ||
12 | %p.nothing_here_message Project activity will be displayed here | 12 | %p.nothing_here_message Project activity will be displayed here |
13 | .loading.hide | 13 | .loading.hide |
14 | .side.span4 | 14 | .side.span4 |
15 | + - if @group.description.present? | ||
16 | + .description.well.light | ||
17 | + = @group.description | ||
15 | = render "projects", projects: @projects | 18 | = render "projects", projects: @projects |
16 | %div | 19 | %div |
17 | %span.rss-icon | 20 | %span.rss-icon |
app/views/teams/edit.html.haml
@@ -12,13 +12,20 @@ | @@ -12,13 +12,20 @@ | ||
12 | .input | 12 | .input |
13 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xlarge left" | 13 | = f.text_field :name, placeholder: "Ex. OpenSource", class: "xlarge left" |
14 | 14 | ||
15 | + .clearfix.team-description-holder | ||
16 | + = f.label :description, "Details" | ||
17 | + .input | ||
18 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
19 | + | ||
15 | .clearfix | 20 | .clearfix |
16 | = f.label :path do | 21 | = f.label :path do |
17 | Team path is | 22 | Team path is |
18 | .input | 23 | .input |
19 | = f.text_field :path, placeholder: "opensource", class: "xlarge left" | 24 | = f.text_field :path, placeholder: "opensource", class: "xlarge left" |
25 | + | ||
20 | .form-actions | 26 | .form-actions |
21 | - = f.submit 'Save team changes', class: "btn btn-save" | 27 | + = f.submit 'Save team changes', class: "btn btn-primary" |
28 | + = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove pull-right" | ||
22 | .span5 | 29 | .span5 |
23 | .ui-box | 30 | .ui-box |
24 | %h5.title Remove team | 31 | %h5.title Remove team |
@@ -26,4 +33,3 @@ | @@ -26,4 +33,3 @@ | ||
26 | %p | 33 | %p |
27 | Removed team can not be restored! | 34 | Removed team can not be restored! |
28 | = link_to 'Remove team', team_path(@team), method: :delete, confirm: "You are sure?", class: "btn btn-remove btn-small" | 35 | = link_to 'Remove team', team_path(@team), method: :delete, confirm: "You are sure?", class: "btn btn-remove btn-small" |
29 | - |
app/views/teams/new.html.haml
@@ -9,9 +9,15 @@ | @@ -9,9 +9,15 @@ | ||
9 | Team name is | 9 | Team name is |
10 | .input | 10 | .input |
11 | = f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left" | 11 | = f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left" |
12 | - | ||
13 | - = f.submit 'Create team', class: "btn btn-create" | ||
14 | - %hr | 12 | + |
13 | + .clearfix.team-description-holder | ||
14 | + = f.label :description, "Details" | ||
15 | + .input | ||
16 | + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 | ||
17 | + | ||
18 | + .form-actions | ||
19 | + = f.submit 'Create team', class: "btn btn-create" | ||
20 | + | ||
15 | .padded | 21 | .padded |
16 | %ul | 22 | %ul |
17 | %li All created teams are public (users can view who enter into team and which project are assigned for this team) | 23 | %li All created teams are public (users can view who enter into team and which project are assigned for this team) |
app/views/teams/show.html.haml
@@ -11,6 +11,9 @@ | @@ -11,6 +11,9 @@ | ||
11 | %p.nothing_here_message Projects activity will be displayed here | 11 | %p.nothing_here_message Projects activity will be displayed here |
12 | .loading.hide | 12 | .loading.hide |
13 | .side.span4 | 13 | .side.span4 |
14 | + - if @team.description.present? | ||
15 | + .description.well.light | ||
16 | + = @team.description | ||
14 | = render "projects", projects: @projects | 17 | = render "projects", projects: @projects |
15 | %div | 18 | %div |
16 | %span.rss-icon | 19 | %span.rss-icon |
db/migrate/20130206084024_add_description_to_namsespace.rb
0 → 100644
db/schema.rb
@@ -106,12 +106,13 @@ ActiveRecord::Schema.define(:version => 20130220133245) do | @@ -106,12 +106,13 @@ ActiveRecord::Schema.define(:version => 20130220133245) do | ||
106 | add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" | 106 | add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" |
107 | 107 | ||
108 | create_table "namespaces", :force => true do |t| | 108 | create_table "namespaces", :force => true do |t| |
109 | - t.string "name", :null => false | ||
110 | - t.string "path", :null => false | ||
111 | - t.integer "owner_id", :null => false | ||
112 | - t.datetime "created_at", :null => false | ||
113 | - t.datetime "updated_at", :null => false | 109 | + t.string "name", :null => false |
110 | + t.string "path", :null => false | ||
111 | + t.integer "owner_id", :null => false | ||
112 | + t.datetime "created_at", :null => false | ||
113 | + t.datetime "updated_at", :null => false | ||
114 | t.string "type" | 114 | t.string "type" |
115 | + t.string "description", :default => "", :null => false | ||
115 | end | 116 | end |
116 | 117 | ||
117 | add_index "namespaces", ["name"], :name => "index_namespaces_on_name" | 118 | add_index "namespaces", ["name"], :name => "index_namespaces_on_name" |
@@ -232,8 +233,9 @@ ActiveRecord::Schema.define(:version => 20130220133245) do | @@ -232,8 +233,9 @@ ActiveRecord::Schema.define(:version => 20130220133245) do | ||
232 | t.string "name" | 233 | t.string "name" |
233 | t.string "path" | 234 | t.string "path" |
234 | t.integer "owner_id" | 235 | t.integer "owner_id" |
235 | - t.datetime "created_at", :null => false | ||
236 | - t.datetime "updated_at", :null => false | 236 | + t.datetime "created_at", :null => false |
237 | + t.datetime "updated_at", :null => false | ||
238 | + t.string "description", :default => "", :null => false | ||
237 | end | 239 | end |
238 | 240 | ||
239 | create_table "users", :force => true do |t| | 241 | create_table "users", :force => true do |t| |
features/steps/admin/admin_groups.rb
@@ -25,11 +25,13 @@ class AdminGroups < Spinach::FeatureSteps | @@ -25,11 +25,13 @@ class AdminGroups < Spinach::FeatureSteps | ||
25 | 25 | ||
26 | And 'submit form with new group info' do | 26 | And 'submit form with new group info' do |
27 | fill_in 'group_name', :with => 'gitlab' | 27 | fill_in 'group_name', :with => 'gitlab' |
28 | + fill_in 'group_description', :with => 'Group description' | ||
28 | click_button "Create group" | 29 | click_button "Create group" |
29 | end | 30 | end |
30 | 31 | ||
31 | Then 'I should see newly created group' do | 32 | Then 'I should see newly created group' do |
32 | page.should have_content "Group: gitlab" | 33 | page.should have_content "Group: gitlab" |
34 | + page.should have_content "Group description" | ||
33 | end | 35 | end |
34 | 36 | ||
35 | Then 'I should be redirected to group page' do | 37 | Then 'I should be redirected to group page' do |
features/steps/admin/admin_teams.rb
@@ -18,6 +18,7 @@ class AdminTeams < Spinach::FeatureSteps | @@ -18,6 +18,7 @@ class AdminTeams < Spinach::FeatureSteps | ||
18 | 18 | ||
19 | And 'submit form with new team info' do | 19 | And 'submit form with new team info' do |
20 | fill_in 'user_team_name', with: 'gitlab' | 20 | fill_in 'user_team_name', with: 'gitlab' |
21 | + fill_in 'user_team_description', with: 'description' | ||
21 | click_button 'Create team' | 22 | click_button 'Create team' |
22 | end | 23 | end |
23 | 24 | ||
@@ -27,6 +28,7 @@ class AdminTeams < Spinach::FeatureSteps | @@ -27,6 +28,7 @@ class AdminTeams < Spinach::FeatureSteps | ||
27 | 28 | ||
28 | And 'I should see newly created team' do | 29 | And 'I should see newly created team' do |
29 | page.should have_content "Team: gitlab" | 30 | page.should have_content "Team: gitlab" |
31 | + page.should have_content "description" | ||
30 | end | 32 | end |
31 | 33 | ||
32 | When 'I visit admin teams page' do | 34 | When 'I visit admin teams page' do |
features/steps/group/group.rb
@@ -69,12 +69,14 @@ class Groups < Spinach::FeatureSteps | @@ -69,12 +69,14 @@ class Groups < Spinach::FeatureSteps | ||
69 | end | 69 | end |
70 | 70 | ||
71 | And 'submit form with new group info' do | 71 | And 'submit form with new group info' do |
72 | - fill_in 'group_name', :with => 'Samurai' | 72 | + fill_in 'group_name', with: 'Samurai' |
73 | + fill_in 'group_description', with: 'Tokugawa Shogunate' | ||
73 | click_button "Create group" | 74 | click_button "Create group" |
74 | end | 75 | end |
75 | 76 | ||
76 | Then 'I should see newly created group' do | 77 | Then 'I should see newly created group' do |
77 | page.should have_content "Samurai" | 78 | page.should have_content "Samurai" |
79 | + page.should have_content "Tokugawa Shogunate" | ||
78 | page.should have_content "You will only see events from projects in this group" | 80 | page.should have_content "You will only see events from projects in this group" |
79 | end | 81 | end |
80 | 82 |
features/steps/userteams/userteams.rb
@@ -44,9 +44,16 @@ class Userteams < Spinach::FeatureSteps | @@ -44,9 +44,16 @@ class Userteams < Spinach::FeatureSteps | ||
44 | 44 | ||
45 | And 'I submit form with new team info' do | 45 | And 'I submit form with new team info' do |
46 | fill_in 'name', with: 'gitlab' | 46 | fill_in 'name', with: 'gitlab' |
47 | + | ||
48 | + fill_in 'user_team_description', with: 'team description' | ||
47 | click_button 'Create team' | 49 | click_button 'Create team' |
48 | end | 50 | end |
49 | 51 | ||
52 | + And 'I should see newly created team' do | ||
53 | + page.should have_content "gitlab" | ||
54 | + page.should have_content "team description" | ||
55 | + end | ||
56 | + | ||
50 | Then 'I should be redirected to new team page' do | 57 | Then 'I should be redirected to new team page' do |
51 | team = UserTeam.last | 58 | team = UserTeam.last |
52 | current_path.should == team_path(team) | 59 | current_path.should == team_path(team) |
features/teams/team.feature
@@ -20,6 +20,7 @@ Feature: UserTeams | @@ -20,6 +20,7 @@ Feature: UserTeams | ||
20 | When I click to "New team" link | 20 | When I click to "New team" link |
21 | And I submit form with new team info | 21 | And I submit form with new team info |
22 | Then I should be redirected to new team page | 22 | Then I should be redirected to new team page |
23 | + Then I should see newly created team | ||
23 | 24 | ||
24 | Scenario: I should see team dashboard list | 25 | Scenario: I should see team dashboard list |
25 | When I have teams with projects and members | 26 | When I have teams with projects and members |
spec/factories/user_teams.rb
@@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
15 | FactoryGirl.define do | 15 | FactoryGirl.define do |
16 | factory :user_team do | 16 | factory :user_team do |
17 | sequence(:name) { |n| "team#{n}" } | 17 | sequence(:name) { |n| "team#{n}" } |
18 | + sequence(:description) { |n| "team_description#{n}" } | ||
18 | path { name.downcase.gsub(/\s/, '_') } | 19 | path { name.downcase.gsub(/\s/, '_') } |
19 | owner | 20 | owner |
20 | end | 21 | end |