Commit 5e73bb25 authored by Erick Banks's avatar Erick Banks

Use let syntax for variables

parent b8ce03a6
...@@ -4,42 +4,42 @@ module QA ...@@ -4,42 +4,42 @@ module QA
context 'Create' do context 'Create' do
describe 'Search using Elasticsearch', :orchestrated, :elasticsearch, :requires_admin do describe 'Search using Elasticsearch', :orchestrated, :elasticsearch, :requires_admin do
include Runtime::Fixtures 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 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 Flow::Login.while_signed_in_as_admin do
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_browser_ui! QA::EE::Resource::Settings::Elasticsearch.fabricate_via_browser_ui!
end end
Runtime::Search.assert_elasticsearch_responding Runtime::Search.assert_elasticsearch_responding
@project = Resource::Project.fabricate_via_api! do |project|
project.name = project_name
end
Flow::Login.sign_in Flow::Login.sign_in
Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
push.project = @project push.project = project
push.file_name = @project_file_name push.file_name = project_file_name
push.file_content = @project_file_content push.file_content = project_file_content
end.project.visit! end.project.visit!
end end
it 'tests reindexing after push', retry: 3 do 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| QA::Page::Main::Menu.perform do |menu|
menu.search_for(@project_file_content) menu.search_for(project_file_content)
end end
Page::Search::Results.perform do |search| Page::Search::Results.perform do |search|
search.switch_to_code 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
end end
...@@ -69,7 +69,7 @@ module QA ...@@ -69,7 +69,7 @@ module QA
Page::Search::Results.perform do |search| Page::Search::Results.perform do |search|
search.switch_to_code 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] expect(search).to have_file_with_content template[:file_name], content[0..33]
end end
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