global_search_spec.rb 696 Bytes
Newer Older
Valery Sizov's avatar
Valery Sizov committed
1 2
require 'spec_helper'

3
describe 'Global search' do
Valery Sizov's avatar
Valery Sizov committed
4
  let(:user) { create(:user) }
5
  let(:project) { create(:project, namespace: user.namespace) }
Valery Sizov's avatar
Valery Sizov committed
6 7

  before do
8
    project.add_maintainer(user)
9
    sign_in(user)
Valery Sizov's avatar
Valery Sizov committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
  end

  describe 'I search through the issues and I see pagination' do
    before do
      allow_any_instance_of(Gitlab::SearchResults).to receive(:per_page).and_return(1)
      create_list(:issue, 2, project: project, title: 'initial')
    end

    it "has a pagination" do
      visit dashboard_projects_path

      fill_in "search", with: "initial"
      click_button "Go"

      select_filter("Issues")
25
      expect(page).to have_selector('.gl-pagination .next')
Valery Sizov's avatar
Valery Sizov committed
26 27 28
    end
  end
end