summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/3_create
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-16 12:06:26 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-16 12:06:26 +0000
commitd2798d607e11e0ebae83ae909404834388733428 (patch)
tree096b7f4d4bdb315d28cdcd4d6db4e80911112e9c /qa/qa/specs/features/browser_ui/3_create
parentd8211a0ed119eada7d292e974a8fc7b0cd982d3c (diff)
downloadgitlab-ce-d2798d607e11e0ebae83ae909404834388733428.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create')
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb
index dd80905d184..5d0f4b215f4 100644
--- a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb
@@ -17,16 +17,11 @@ module QA
Page::Main::Login.perform(&:sign_in_using_credentials)
end
- after do
- # We need to clear localStorage because we're using it for the dropdown,
- # and capybara doesn't do this for us.
- # https://github.com/teamcapybara/capybara/issues/1702
- Capybara.execute_script 'localStorage.clear()'
- end
-
context 'when developers and maintainers are allowed to push to a protected branch' do
it 'user with push rights successfully pushes to the protected branch' do
- create_protected_branch(allow_to_push: true)
+ create_protected_branch(allowed_to_push: {
+ roles: Resource::ProtectedBranch::Roles::DEVS_AND_MAINTAINERS
+ })
push = push_new_file(branch_name)
@@ -36,18 +31,19 @@ module QA
context 'when developers and maintainers are not allowed to push to a protected branch' do
it 'user without push rights fails to push to the protected branch' do
- create_protected_branch(allow_to_push: false)
+ create_protected_branch(allowed_to_push: {
+ roles: Resource::ProtectedBranch::Roles::NO_ONE
+ })
expect { push_new_file(branch_name) }.to raise_error(QA::Git::Repository::RepositoryCommandError, /remote: GitLab: You are not allowed to push code to protected branches on this project\.([\s\S]+)\[remote rejected\] #{branch_name} -> #{branch_name} \(pre-receive hook declined\)/)
end
end
- def create_protected_branch(allow_to_push:)
+ def create_protected_branch(allowed_to_push:)
Resource::ProtectedBranch.fabricate! do |resource|
resource.branch_name = branch_name
resource.project = project
- resource.allow_to_push = allow_to_push
- resource.protected = true
+ resource.allowed_to_push = allowed_to_push
end
end