summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-10-06 17:04:45 -0500
committerJose Ivan Vargas <jvargas@gitlab.com>2017-10-06 17:04:45 -0500
commit26b66e58ca4179ab8720f48c72e75aa3bac05911 (patch)
treeeb4ea871c93059b87820df6a7e44be5134dadbb6
parent3cbab382f678cef273cde319aae55f050d27527d (diff)
downloadgitlab-ce-26b66e58ca4179ab8720f48c72e75aa3bac05911.tar.gz
backport protected_branches_spec improvements from EEbackport-protected-branches-spec-changes
-rw-r--r--spec/features/protected_branches_spec.rb26
1 files changed, 17 insertions, 9 deletions
diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb
index aaf3d6d28ca..2ab1eda90f1 100644
--- a/spec/features/protected_branches_spec.rb
+++ b/spec/features/protected_branches_spec.rb
@@ -64,16 +64,24 @@ feature 'Protected Branches', :js do
describe "Saved defaults" do
it "keeps the allowed to merge and push dropdowns defaults based on the previous selection" do
visit project_protected_branches_path(project)
- find(".js-allowed-to-merge").trigger('click')
- click_link 'No one'
- find(".js-allowed-to-push").trigger('click')
- click_link 'Developers + Masters'
- visit project_protected_branches_path(project)
- page.within(".js-allowed-to-merge") do
- expect(page.find(".dropdown-toggle-text")).to have_content("No one")
+ form = '.js-new-protected-branch'
+
+ within form do
+ find(".js-allowed-to-merge").trigger('click')
+ click_link 'No one'
+ find(".js-allowed-to-push").trigger('click')
+ click_link 'Developers + Masters'
end
- page.within(".js-allowed-to-push") do
- expect(page.find(".dropdown-toggle-text")).to have_content("Developers + Masters")
+
+ visit project_protected_branches_path(project)
+
+ within form do
+ page.within(".js-allowed-to-merge") do
+ expect(page.find(".dropdown-toggle-text")).to have_content("No one")
+ end
+ page.within(".js-allowed-to-push") do
+ expect(page.find(".dropdown-toggle-text")).to have_content("Developers + Masters")
+ end
end
end
end