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

_results.html.haml_spec.rb « search « views « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 177ade3b700f72fc2237d162dbd6f229d00e1abe (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
33
# frozen_string_literal: true

require 'spec_helper'

describe 'search/_results' do
  before do
    controller.params[:action] = 'show'

    3.times { create(:issue) }

    @search_objects = Issue.page(1).per(2)
    @scope = 'issues'
    @search_term = 'foo'
  end

  it 'displays the page size' do
    render

    expect(rendered).to have_content('Showing 1 - 2 of 3 issues for "foo"')
  end

  context 'when search results do not have a count' do
    before do
      @search_objects = @search_objects.without_count
    end

    it 'does not display the page size' do
      render

      expect(rendered).not_to have_content(/Showing .* of .*/)
    end
  end
end