search_spec.rb 496 Bytes
Newer Older
randx's avatar
randx committed
1 2
require 'spec_helper'

3
describe "Search", feature: true  do
randx's avatar
randx committed
4
  before do
5
    ActiveRecord::Base.observers.enable(:user_observer)
randx's avatar
randx committed
6
    login_as :user
7
    @project = create(:project, namespace: @user.namespace)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
8
    @project.team << [@user, :reporter]
randx's avatar
randx committed
9
    visit search_path
10 11 12 13 14

    within '.search-holder' do
      fill_in "search", with: @project.name[0..3]
      click_button "Search"
    end
randx's avatar
randx committed
15 16
  end

17
  it "should show project in search results" do
randx's avatar
randx committed
18 19 20 21
    page.should have_content @project.name
  end
end