diff options
author | Nick Thomas <nick@gitlab.com> | 2018-11-09 13:49:26 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-11-09 13:49:26 +0000 |
commit | aa958abae01a0744f398b7b4691515d636393af7 (patch) | |
tree | 449a3208b52bbefb44edcf3b3caba39e175d0aff | |
parent | 7a506e3957eca46c202388bb98f0554893b7348a (diff) | |
parent | 1618282e5a1618fcd639b27f67eb984b3786d83e (diff) | |
download | gitlab-ce-aa958abae01a0744f398b7b4691515d636393af7.tar.gz |
Merge branch 'qa-git-protocol-v2-http-spec' into 'master'
Add e2e test of push via HTTP via Git protocol v2
See merge request gitlab-org/gitlab-ce!22925
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb new file mode 100644 index 00000000000..43894372cf5 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module QA + context 'Create' do + describe 'Push over HTTP using Git protocol version 2', :requires_git_protocol_v2 do + it 'user pushes to the repository' do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + Page::Main::Login.perform(&:sign_in_using_credentials) + + # Create a project to push to + project = Resource::Project.fabricate! do |project| + project.name = 'git-protocol-project' + end + + file_name = 'README.md' + file_content = 'Test Git protocol v2' + git_protocol = '2' + git_protocol_reported = nil + + # Use Git to clone the project, push a file to it, and then check the + # supported Git protocol + Git::Repository.perform do |repository| + username = 'GitLab QA' + email = 'root@gitlab.com' + + repository.uri = project.repository_http_location.uri + repository.use_default_credentials + repository.clone + repository.configure_identity(username, email) + + git_protocol_reported = repository.push_with_git_protocol( + git_protocol, + file_name, + file_content) + end + + project.visit! + Page::Project::Show.perform(&:wait_for_push) + + # Check that the push worked + expect(page).to have_content(file_name) + expect(page).to have_content(file_content) + + # And check that the correct Git protocol was used + expect(git_protocol_reported).to eq(git_protocol) + end + end + end +end |