summaryrefslogtreecommitdiff
path: root/spec/frontend/fixtures/search.rb
blob: fcd68662acc17a03f6f9cc4a8273a03751928ed9 (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
34
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe SearchController, '(JavaScript fixtures)', type: :controller do
  include JavaScriptFixturesHelpers

  render_views

  before(:all) do
    clean_frontend_fixtures('search/')
  end

  it 'search/show.html' do
    get :show

    expect(response).to be_successful
  end

  context 'search within a project' do
    let(:namespace) { create(:namespace, name: 'frontend-fixtures') }
    let(:project) { create(:project, :public, :repository, namespace: namespace, path: 'search-project') }

    it 'search/blob_search_result.html' do
      get :show, params: {
        search: 'Send',
        project_id: project.id,
        scope: :blobs
      }

      expect(response).to be_successful
    end
  end
end