Commit 19e2bf1c authored by Alfredo Sumaran's avatar Alfredo Sumaran

Fix failing specs and improve html

parent 894bd04d
......@@ -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)
......
......@@ -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;
}
}
}
......@@ -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
......
......@@ -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
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment