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) ...@@ -31,6 +31,7 @@ v 8.12.0 (unreleased)
- Fix markdown anchor icon interaction (ClemMakesApps) - Fix markdown anchor icon interaction (ClemMakesApps)
- Test migration paths from 8.5 until current release !4874 - Test migration paths from 8.5 until current release !4874
- Replace animateEmoji timeout with eventListener (ClemMakesApps) - 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) - Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel) - Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import - Remove Gitorious import
...@@ -364,9 +365,6 @@ v 8.10.1 ...@@ -364,9 +365,6 @@ v 8.10.1
- Add links to the real markdown.md file for all GFM examples. !5458 - Add links to the real markdown.md file for all GFM examples. !5458
v 8.10.0 v 8.10.0
- Show badges in Milestone tabs
v 8.10.0 (unreleased)
- Fix profile activity heatmap to show correct day name (eanplatter) - Fix profile activity heatmap to show correct day name (eanplatter)
- Speed up ExternalWikiHelper#get_project_wiki_path - Speed up ExternalWikiHelper#get_project_wiki_path
- Expose {should,force}_remove_source_branch (Ben Boeckel) - Expose {should,force}_remove_source_branch (Ben Boeckel)
......
...@@ -68,3 +68,14 @@ ...@@ -68,3 +68,14 @@
border-bottom: 1px solid $border-color; border-bottom: 1px solid $border-color;
padding: 20px 0; 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 ...@@ -50,7 +50,7 @@ module MilestonesHelper
# Show 'active' class if provided GET param matches check # Show 'active' class if provided GET param matches check
# `or_blank` allows the function to return 'active' when given an empty param # `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 # 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 if match_blank_param
'active' if param.blank? || param == check 'active' if param.blank? || param == check
else else
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
- if @project - if @project
.row .row
.col-sm-6= render('shared/milestone_expired', milestone: milestone) .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? - 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 = link_to edit_namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone), class: "btn btn-xs btn-grouped" do
Edit Edit
......
require 'spec_helper' require 'spec_helper'
describe MilestonesHelper do describe MilestonesHelper do
describe '#milestone_counts' do describe '#milestone_counts' do
let(:project) { FactoryGirl.create(:project) } let(:project) { FactoryGirl.create(:project) }
let(:milestone_1) { FactoryGirl.create(:active_milestone, project: project) } let!(:milestone_1) { FactoryGirl.create(:active_milestone, project: project) }
let(:milestone_2) { 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_3) { FactoryGirl.create(:closed_milestone, project: project) }
let(:counts) { helper.milestone_counts(project.milestones) } let(:counts) { helper.milestone_counts(project.milestones) }
it 'returns a hash containing three items' do it 'returns a hash containing three items' do
expect(counts.length).to eq 3 expect(counts.length).to eq 3
end end
it 'returns a hash containing "opened" key' do it 'returns a hash containing "opened" key' do
expect(counts.has_key?(:opened)).to eq true expect(counts.has_key?(:opened)).to eq true
end end
it 'returns a hash containing "closed" key' do it 'returns a hash containing "closed" key' do
expect(counts.has_key?(:closed)).to eq true expect(counts.has_key?(:closed)).to eq true
end end
it 'returns a hash containing "all" key' do it 'returns a hash containing "all" key' do
expect(counts.has_key?(:all)).to eq true expect(counts.has_key?(:all)).to eq true
end 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
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