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

user_searches_for_projects_spec.rb 939 Bytes
Newer Older
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 34 35 36
require 'spec_helper'

describe 'User searches for projects' do
  let!(:project) { create(:project, :public, name: 'Shop') }

  context 'when signed out' do
    include_examples 'top right search form'

    it 'finds a project' do
      visit(search_path)

      fill_in('dashboard_search', with: project.name[0..3])
      click_button('Search')

      expect(page).to have_link(project.name)
    end

    it 'preserves the group being searched in' do
      visit(search_path(group_id: project.namespace.id))

      fill_in('search', with: 'foo')
      click_button('Search')

      expect(find('#group_id', visible: false).value).to eq(project.namespace.id.to_s)
    end

    it 'preserves the project being searched in' do
      visit(search_path(project_id: project.id))

      fill_in('search', with: 'foo')
      click_button('Search')

      expect(find('#project_id', visible: false).value).to eq(project.id.to_s)
    end
  end
end