summaryrefslogtreecommitdiff
path: root/spec/features/protected_branches_spec.rb
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-10-05 16:41:57 -0500
committerJose Ivan Vargas <jvargas@gitlab.com>2017-10-05 16:41:57 -0500
commit10dfa99342f153e6c9c87c85fd05da884d2c37b4 (patch)
treec8ffd6de1621ba70105ff86323d7d4a76c70b69d /spec/features/protected_branches_spec.rb
parent2e76b8a960313feedaaace06503cba097572747e (diff)
downloadgitlab-ce-10dfa99342f153e6c9c87c85fd05da884d2c37b4.tar.gz
fix protected_branch spec describe block38835-protected-branch-selector-not-found-in-test
Diffstat (limited to 'spec/features/protected_branches_spec.rb')
-rw-r--r--spec/features/protected_branches_spec.rb35
1 files changed, 17 insertions, 18 deletions
diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb
index 44c20d4a8d5..aaf3d6d28ca 100644
--- a/spec/features/protected_branches_spec.rb
+++ b/spec/features/protected_branches_spec.rb
@@ -60,6 +60,23 @@ feature 'Protected Branches', :js do
expect(page).to have_content('No branches to show')
end
end
+
+ 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")
+ end
+ page.within(".js-allowed-to-push") do
+ expect(page.find(".dropdown-toggle-text")).to have_content("Developers + Masters")
+ end
+ end
+ end
end
context 'logged in as admin' do
@@ -150,22 +167,4 @@ feature 'Protected Branches', :js do
find(".dropdown-input-field").set(branch_name)
click_on("Create wildcard #{branch_name}")
end
-
- 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)
- set_protected_branch_name('some-branch')
- 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")
- end
- page.within(".js-allowed-to-push") do
- expect(page.find(".dropdown-toggle-text")).to have_content("Developers + Masters")
- end
- end
- end
end