gitlab-org--gitlab-foss/spec/views/shared/milestones/_issuables.html.haml.rb
Thong Kuah 4ec16912b8 Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'

Note: I had to manually fixup "onlies" to "only"
2019-04-05 08:43:27 +00:00

32 lines
1 KiB
Ruby

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 'shows the issuables count if show_counter is true' do
render 'shared/milestones/issuables', show_counter: true
expect(rendered).to have_content('100')
end
it 'does 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 'shows 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