2019-10-17 02:07:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-01-17 18:32:42 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe SearchController, '(JavaScript fixtures)', type: :controller do
|
|
|
|
include JavaScriptFixturesHelpers
|
|
|
|
|
|
|
|
render_views
|
|
|
|
|
|
|
|
before(:all) do
|
|
|
|
clean_frontend_fixtures('search/')
|
|
|
|
end
|
|
|
|
|
2019-04-21 06:58:07 -04:00
|
|
|
it 'search/show.html' do
|
2018-01-17 18:32:42 -05:00
|
|
|
get :show
|
|
|
|
|
2019-07-17 18:15:53 -04:00
|
|
|
expect(response).to be_successful
|
2018-01-17 18:32:42 -05:00
|
|
|
end
|
2020-03-23 05:09:42 -04:00
|
|
|
|
|
|
|
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
|
2018-01-17 18:32:42 -05:00
|
|
|
end
|