Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-08-16 08:44:45 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-08-16 08:44:45 +0300
commit4c28d62672b0f51feede94d9f207f4043c4431f1 (patch)
tree826b839b738bde4455449ab5e4d3cfd5880345cf /spec/features/protected_branches_spec.rb
parente805a6470031d942f7de604fdf7acfc7cf4f0b1a (diff)
Don't select an access level if already selected.
1. This is in regard to the protected branches feature spec. 2. For example, if "Masters" is already selected, don't re-select "Masters" during the spec. 3. This is due to a bug in the frontend implementation, where selecting an already-selected access level _deselects_ it, which is something we don't need. I'll create a separate issue for this. 4. This hasn't turned up before, because we were manually creating missing access levels prior to e805a64. Now, we just use nested attributes, and missing access levels fail validation.
Diffstat (limited to 'spec/features/protected_branches_spec.rb')
-rw-r--r--spec/features/protected_branches_spec.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb
index 5beb658b2f5..709ce7f33b9 100644
--- a/spec/features/protected_branches_spec.rb
+++ b/spec/features/protected_branches_spec.rb
@@ -93,8 +93,12 @@ feature 'Projected Branches', feature: true, js: true do
visit namespace_project_protected_branches_path(project.namespace, project)
set_protected_branch_name('master')
within('.new_protected_branch') do
- find(".js-allowed-to-push").click
- within(".dropdown.open .dropdown-menu") { click_on access_type_name }
+ allowed_to_push_button = find(".js-allowed-to-push")
+
+ unless allowed_to_push_button.text == access_type_name
+ allowed_to_push_button.click
+ within(".dropdown.open .dropdown-menu") { click_on access_type_name }
+ end
end
click_on "Protect"
@@ -124,8 +128,12 @@ feature 'Projected Branches', feature: true, js: true do
visit namespace_project_protected_branches_path(project.namespace, project)
set_protected_branch_name('master')
within('.new_protected_branch') do
- find(".js-allowed-to-merge").click
- within(".dropdown.open .dropdown-menu") { click_on access_type_name }
+ allowed_to_merge_button = find(".js-allowed-to-merge")
+
+ unless allowed_to_merge_button.text == access_type_name
+ allowed_to_merge_button.click
+ within(".dropdown.open .dropdown-menu") { click_on access_type_name }
+ end
end
click_on "Protect"