Commit 0fd1a06c authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'egb-refactor-es-3169' into 'master'

Use let syntax for variables

See merge request gitlab-org/gitlab!34013
parents 3c8b77ea 5e73bb25
......@@ -4,42 +4,42 @@ module QA
context 'Create' do
describe 'Search using Elasticsearch', :orchestrated, :elasticsearch, :requires_admin do
include Runtime::Fixtures
let(:project_name) { 'testing_elasticsearch_indexing' }
let(:project_file_name) { 'elasticsearch.rb' }
let(:project_file_content) { 'elasticsearch: true' }
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = project_name
end
end
before do
project_name = 'testing_elasticsearch_indexing'
@project_file_name = 'elasticsearch.rb'
@project_file_content = 'elasticsearch: true'
Flow::Login.while_signed_in_as_admin do
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_browser_ui!
end
Runtime::Search.assert_elasticsearch_responding
@project = Resource::Project.fabricate_via_api! do |project|
project.name = project_name
end
Flow::Login.sign_in
Resource::Repository::ProjectPush.fabricate! do |push|
push.project = @project
push.file_name = @project_file_name
push.file_content = @project_file_content
push.project = project
push.file_name = project_file_name
push.file_content = project_file_content
end.project.visit!
end
it 'tests reindexing after push', retry: 3 do
expect { Runtime::Search.find_code(@project_file_name, @project_file_content) }.not_to raise_error
expect { Runtime::Search.find_code(project_file_name, project_file_content) }.not_to raise_error
QA::Page::Main::Menu.perform do |menu|
menu.search_for(@project_file_content)
menu.search_for(project_file_content)
end
Page::Search::Results.perform do |search|
search.switch_to_code
expect(search).to have_file_with_content @project_file_name, @project_file_content
expect(search).to have_file_with_content project_file_name, project_file_content
end
end
......@@ -69,7 +69,7 @@ module QA
Page::Search::Results.perform do |search|
search.switch_to_code
expect(search).to have_file_in_project template[:file_name], @project.name
expect(search).to have_file_in_project template[:file_name], project.name
expect(search).to have_file_with_content template[:file_name], content[0..33]
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment