Commit 8bacc5bc authored by Clement Ho's avatar Clement Ho

Merge branch 'ryancharris/gitlab-ce-25277-milestone-counter-number-with-delimiter' into 'master'

View spec for Ryancharris/gitlab milestone counter number with delimiter

See merge request !8482
parents 2a5e63a8 37bbdb60
......@@ -9,6 +9,7 @@
- if show_counter
.right
= issuables.size
.pull-right= number_with_delimiter(issuables.size)
- class_prefix = dom_class(issuables).pluralize
%ul{ class: "well-list #{class_prefix}-sortable-list", id: "#{class_prefix}-list-#{id}", "data-state" => id }
......
---
title: Added number_with_delimiter to counter on milestone panels
merge_request:
author: Ryan Harris
require 'spec_helper'
describe 'shared/milestones/_issuables.html.haml' do
let(:issuables_size) { 100 }
before do
allow(view).to receive_messages(title: nil, id: nil, show_project_name: nil,
show_full_project_name: nil, dom_class: '',
issuables: double(size: issuables_size).as_null_object)
stub_template 'shared/milestones/_issuable.html.haml' => ''
end
it 'should show the issuables count if show_counter is true' do
render 'shared/milestones/issuables', show_counter: true
expect(rendered).to have_content('100')
end
it 'should not show the issuables count if show_counter is false' do
render 'shared/milestones/issuables', show_counter: false
expect(rendered).not_to have_content('100')
end
describe 'a high issuables count' do
let(:issuables_size) { 1000 }
it 'should show a delimited number if show_counter is true' do
render 'shared/milestones/issuables', show_counter: true
expect(rendered).to have_content('1,000')
end
end
end
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