summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-08-22 17:58:28 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-09-07 15:27:14 -0500
commit19e2bf1c21a853e45db0c18133e5f1b1234ad09f (patch)
tree35499078416f41c25f76040962943b00e55ff40c
parent894bd04decf1a2e6a7ca7b1450db9ac7bddd4735 (diff)
downloadgitlab-ce-19e2bf1c21a853e45db0c18133e5f1b1234ad09f.tar.gz
Fix failing specs and improve html
-rw-r--r--CHANGELOG4
-rw-r--r--app/assets/stylesheets/pages/milestone.scss11
-rw-r--r--app/helpers/milestones_helper.rb2
-rw-r--r--app/views/shared/milestones/_milestone.html.haml2
-rw-r--r--spec/helpers/milestones_helper_spec.rb22
5 files changed, 26 insertions, 15 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c12677e1f7c..819add7049e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -31,6 +31,7 @@ v 8.12.0 (unreleased)
- Fix markdown anchor icon interaction (ClemMakesApps)
- Test migration paths from 8.5 until current release !4874
- Replace animateEmoji timeout with eventListener (ClemMakesApps)
+ - Show badges in Milestone tabs. !5946 (Dan Rowden)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import
@@ -364,9 +365,6 @@ v 8.10.1
- Add links to the real markdown.md file for all GFM examples. !5458
v 8.10.0
- - Show badges in Milestone tabs
-
-v 8.10.0 (unreleased)
- Fix profile activity heatmap to show correct day name (eanplatter)
- Speed up ExternalWikiHelper#get_project_wiki_path
- Expose {should,force}_remove_source_branch (Ben Boeckel)
diff --git a/app/assets/stylesheets/pages/milestone.scss b/app/assets/stylesheets/pages/milestone.scss
index 94b2a0d88a1..6b865730487 100644
--- a/app/assets/stylesheets/pages/milestone.scss
+++ b/app/assets/stylesheets/pages/milestone.scss
@@ -68,3 +68,14 @@
border-bottom: 1px solid $border-color;
padding: 20px 0;
}
+
+@media (max-width: $screen-sm-min) {
+ .milestone-actions {
+ @include clearfix();
+ padding-top: $gl-vert-padding;
+
+ .btn:first-child {
+ margin-left: 0;
+ }
+ }
+}
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb
index 27f4354cf42..b91f09f76ee 100644
--- a/app/helpers/milestones_helper.rb
+++ b/app/helpers/milestones_helper.rb
@@ -50,7 +50,7 @@ module MilestonesHelper
# Show 'active' class if provided GET param matches check
# `or_blank` allows the function to return 'active' when given an empty param
# Could be refactored to be simpler but that may make it harder to read
- def milestone_class_for_state(param, check, match_blank_param=false)
+ def milestone_class_for_state(param, check, match_blank_param = false)
if match_blank_param
'active' if param.blank? || param == check
else
diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml
index acc3ccf4dcf..3dccfb147bf 100644
--- a/app/views/shared/milestones/_milestone.html.haml
+++ b/app/views/shared/milestones/_milestone.html.haml
@@ -33,7 +33,7 @@
- if @project
.row
.col-sm-6= render('shared/milestone_expired', milestone: milestone)
- .col-sm-6
+ .col-sm-6.milestone-actions
- if can?(current_user, :admin_milestone, milestone.project) and milestone.active?
= link_to edit_namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone), class: "btn btn-xs btn-grouped" do
Edit
diff --git a/spec/helpers/milestones_helper_spec.rb b/spec/helpers/milestones_helper_spec.rb
index 8e23415bfe4..d65610723b0 100644
--- a/spec/helpers/milestones_helper_spec.rb
+++ b/spec/helpers/milestones_helper_spec.rb
@@ -1,33 +1,35 @@
require 'spec_helper'
describe MilestonesHelper do
-
describe '#milestone_counts' do
let(:project) { FactoryGirl.create(:project) }
- let(:milestone_1) { FactoryGirl.create(:active_milestone, project: project) }
- let(:milestone_2) { FactoryGirl.create(:active_milestone, project: project) }
- let(:milestone_3) { FactoryGirl.create(:closed_milestone, project: project) }
+ let!(:milestone_1) { FactoryGirl.create(:active_milestone, project: project) }
+ let!(:milestone_2) { FactoryGirl.create(:active_milestone, project: project) }
+ let!(:milestone_3) { FactoryGirl.create(:closed_milestone, project: project) }
let(:counts) { helper.milestone_counts(project.milestones) }
it 'returns a hash containing three items' do
expect(counts.length).to eq 3
end
+
it 'returns a hash containing "opened" key' do
expect(counts.has_key?(:opened)).to eq true
end
+
it 'returns a hash containing "closed" key' do
expect(counts.has_key?(:closed)).to eq true
end
+
it 'returns a hash containing "all" key' do
expect(counts.has_key?(:all)).to eq true
end
- # This throws a "NoMethodError: undefined method `+' for nil:NilClass" error for line 27; can't figure out why it can't find the keys in the hash
- # it 'shows "all" object is the sum of "opened" and "closed" objects' do
- # total = counts[:opened] + counts[:closed]
- # expect(counts[:all]).to eq total
- # end
+ it 'shows "all" object is the sum of "opened" and "closed" objects' do
+ puts counts.as_json
+ total = counts[:opened] + counts[:closed]
+ expect(counts[:all]).to eq total
+ end
end
-
end
+ \ No newline at end of file