backport protected_branches_spec improvements from EE

This commit is contained in:
Jose Ivan Vargas 2017-10-06 17:04:45 -05:00
parent 3cbab382f6
commit 26b66e58ca

View file

@ -64,16 +64,24 @@ feature 'Protected Branches', :js do
describe "Saved defaults" do describe "Saved defaults" do
it "keeps the allowed to merge and push dropdowns defaults based on the previous selection" do it "keeps the allowed to merge and push dropdowns defaults based on the previous selection" do
visit project_protected_branches_path(project) visit project_protected_branches_path(project)
find(".js-allowed-to-merge").trigger('click') form = '.js-new-protected-branch'
click_link 'No one'
find(".js-allowed-to-push").trigger('click') within form do
click_link 'Developers + Masters' find(".js-allowed-to-merge").trigger('click')
visit project_protected_branches_path(project) click_link 'No one'
page.within(".js-allowed-to-merge") do find(".js-allowed-to-push").trigger('click')
expect(page.find(".dropdown-toggle-text")).to have_content("No one") click_link 'Developers + Masters'
end 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 end
end end