GitLab steht Mittwoch, den 08. Juli, zwischen 09:00 und 13:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

user_searches_for_wiki_pages_spec.rb 880 Bytes
Newer Older
1 2 3 4
require 'spec_helper'

describe 'User searches for wiki pages', :js do
  let(:user) { create(:user) }
5
  let(:project) { create(:project, :repository, :wiki_repo, namespace: user.namespace) }
6 7 8
  let!(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'test_wiki', content: 'Some Wiki content' }) }

  before do
9
    project.add_maintainer(user)
10 11 12 13 14 15 16 17
    sign_in(user)

    visit(search_path)
  end

  include_examples 'top right search form'

  it 'finds a page' do
18
    find('.js-search-project-dropdown').click
19 20

    page.within('.project-filter') do
21
      click_link(project.full_name)
22 23 24
    end

    fill_in('dashboard_search', with: 'content')
25
    find('.btn-search').click
26 27 28 29 30 31 32 33 34 35

    page.within('.search-filter') do
      click_link('Wiki')
    end

    page.within('.results') do
      expect(find(:css, '.search-results')).to have_link(wiki_page.title)
    end
  end
end