Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_issuables.html.haml.rb « milestones « shared « views « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4769d569548840cd2e55fcf9e3b52ff26632bdff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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