Commit 8dd25bc5 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Use Factory::Repository::Push.fabricate!

parent e90bf94e
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
Factory::Resource::Project.fabricate! do |project| project = Factory::Resource::Project.fabricate! do |project|
project.name = 'geo-before-rename' project.name = 'geo-before-rename'
project.description = 'Geo project to be renamed' project.description = 'Geo project to be renamed'
end end
...@@ -13,21 +13,11 @@ module QA ...@@ -13,21 +13,11 @@ module QA
geo_project_name = Page::Project::Show.act { project_name } geo_project_name = Page::Project::Show.act { project_name }
expect(geo_project_name).to include 'geo-before-rename' expect(geo_project_name).to include 'geo-before-rename'
Git::Repository.perform do |repository| Factory::Repository::Push.fabricate! do |push|
repository.location = Page::Project::Show.act do push.file_name = 'README.md'
choose_repository_clone_http push.file_content = '# This is Geo project!'
repository_location push.commit_message = 'Add README.md'
end push.project = project
repository.use_default_credentials
repository.act do
clone
configure_identity('GitLab QA', 'root@gitlab.com')
add_file('README.md', '# This is Geo project!')
commit('Add README.md')
push_changes
end
end end
# check it exists on the other machine # check it exists on the other machine
......
...@@ -4,7 +4,7 @@ module QA ...@@ -4,7 +4,7 @@ module QA
Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials } Page::Main::Login.act { sign_in_using_credentials }
Factory::Resource::Project.fabricate! do |project| project = Factory::Resource::Project.fabricate! do |project|
project.name = 'geo-project' project.name = 'geo-project'
project.description = 'Geo test project' project.description = 'Geo test project'
end end
...@@ -12,21 +12,11 @@ module QA ...@@ -12,21 +12,11 @@ module QA
geo_project_name = Page::Project::Show.act { project_name } geo_project_name = Page::Project::Show.act { project_name }
expect(geo_project_name).to include 'geo-project' expect(geo_project_name).to include 'geo-project'
Git::Repository.perform do |repository| Factory::Repository::Push.fabricate! do |push|
repository.location = Page::Project::Show.act do push.file_name = 'README.md'
choose_repository_clone_http push.file_content = '# This is Geo project!'
repository_location push.commit_message = 'Add README.md'
end push.project = project
repository.use_default_credentials
repository.act do
clone
configure_identity('GitLab QA', 'root@gitlab.com')
add_file('README.md', '# This is Geo project!')
commit('Add README.md')
push_changes
end
end end
Runtime::Browser.visit(:geo_secondary, QA::Page::Main::Login) do Runtime::Browser.visit(:geo_secondary, QA::Page::Main::Login) do
......
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