diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-06-30 18:18:26 +0400 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-06-30 18:18:26 +0400 |
commit | 3e52517da1c506885c06c13ff59ff5863bcb68ea (patch) | |
tree | 42e24badc647d7d4240e01a50d0c1b1d038251ea /app | |
parent | eb5182ac8da38e0eadd87cee7385965f05dabc9d (diff) |
Add feature tests for group milestone.
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/groups/milestones_controller.rb | 2 | ||||
-rw-r--r-- | app/models/group_milestone.rb | 2 | ||||
-rw-r--r-- | app/views/groups/milestones/index.html.haml | 10 | ||||
-rw-r--r-- | app/views/groups/milestones/show.html.haml | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 4f7096c42bd..8dde8e91468 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -41,7 +41,7 @@ class Groups::MilestonesController < ApplicationController end def title - params[:id].gsub("-", ".") + params[:title] end def status(state) diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb index 7af61f97a63..013f8db00a7 100644 --- a/app/models/group_milestone.rb +++ b/app/models/group_milestone.rb @@ -10,7 +10,7 @@ class GroupMilestone end def safe_title - @title.gsub(".", "-") + @title.parameterize end def milestones diff --git a/app/views/groups/milestones/index.html.haml b/app/views/groups/milestones/index.html.haml index 671f81ba06f..9dd8fa96640 100644 --- a/app/views/groups/milestones/index.html.haml +++ b/app/views/groups/milestones/index.html.haml @@ -26,17 +26,17 @@ .pull-right - if can?(current_user, :manage_group, @group) - if milestone.closed? - = link_to 'Reopen Milestone', group_milestone_path(@group, milestone.safe_title, milestone: {state_event: :activate }), method: :put, class: "btn btn-small btn-grouped" + = link_to 'Reopen Milestone', group_milestone_path(@group, milestone.safe_title, title: milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-small btn-grouped" - else - = link_to 'Close Milestone', group_milestone_path(@group, milestone.safe_title, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" + = link_to 'Close Milestone', group_milestone_path(@group, milestone.safe_title, title: milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" %h4 - = link_to_gfm truncate(milestone.title, length: 100), group_milestone_path(@group, milestone.safe_title) + = link_to_gfm truncate(milestone.title, length: 100), group_milestone_path(@group, milestone.safe_title, title: milestone.title) %div %div - = link_to group_milestone_path(@group, milestone.safe_title, anchor: 'tab-issues') do + = link_to group_milestone_path(@group, milestone.safe_title, title: milestone.title) do = pluralize milestone.issue_count, 'Issue' - = link_to group_milestone_path(@group, milestone.safe_title, anchor: 'tab-merge-requests') do + = link_to group_milestone_path(@group, milestone.safe_title, title: milestone.title) do = pluralize milestone.merge_requests_count, 'Merge Request' %span.light #{milestone.percent_complete}% complete diff --git a/app/views/groups/milestones/show.html.haml b/app/views/groups/milestones/show.html.haml index 1ed5907b718..d39870b032c 100644 --- a/app/views/groups/milestones/show.html.haml +++ b/app/views/groups/milestones/show.html.haml @@ -3,9 +3,9 @@ .pull-right - if can?(current_user, :manage_group, @group) - if @group_milestone.active? - = link_to 'Close Milestone', group_milestone_path(@group, @group_milestone.safe_title, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" + = link_to 'Close Milestone', group_milestone_path(@group, @group_milestone.safe_title, title: @group_milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" - else - = link_to 'Reopen Milestone', group_milestone_path(@group, @group_milestone.safe_title, milestone: {state_event: :activate }), method: :put, class: "btn btn-small btn-grouped" + = link_to 'Reopen Milestone', group_milestone_path(@group, @group_milestone.safe_title, title: @group_milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-small btn-grouped" - if (@group_milestone.total_items_count == @group_milestone.closed_items_count) && @group_milestone.active? .alert.alert-success |