Commit 88fd401d authored by Timothy Andrew's avatar Timothy Andrew

Implement review comments from @axil.

1. Align "Allowed to Merge" and "Allowed to Push" dropdowns.

2. Don't display a flash every time a protected branch is updated.
   Previously, we were using this so the test has something to hook onto
   before the assertion. Now we're using `wait_for_ajax` instead.
parent a72d4491
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
are supported. are supported.
.form-group .form-group
.prepend-left-10
= f.hidden_field :allowed_to_merge = f.hidden_field :allowed_to_merge
= f.label :allowed_to_merge, "Allowed to merge: ", class: "label-light append-bottom-0" = f.label :allowed_to_merge, "Allowed to merge: ", class: "label-light append-bottom-0"
= dropdown_tag("<Make a selection>", = dropdown_tag("<Make a selection>",
...@@ -41,7 +40,6 @@ ...@@ -41,7 +40,6 @@
data: { field_name: "protected_branch[allowed_to_merge]" }}) data: { field_name: "protected_branch[allowed_to_merge]" }})
.form-group .form-group
.prepend-left-10
= f.hidden_field :allowed_to_push = f.hidden_field :allowed_to_push
= f.label :allowed_to_push, "Allowed to push: ", class: "label-light append-bottom-0" = f.label :allowed_to_push, "Allowed to push: ", class: "label-light append-bottom-0"
= dropdown_tag("<Make a selection>", = dropdown_tag("<Make a selection>",
......
require 'spec_helper' require 'spec_helper'
feature 'Projected Branches', feature: true, js: true do feature 'Projected Branches', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
let(:project) { create(:project) } let(:project) { create(:project) }
...@@ -109,7 +111,7 @@ feature 'Projected Branches', feature: true, js: true do ...@@ -109,7 +111,7 @@ feature 'Projected Branches', feature: true, js: true do
within('.dropdown-menu.push') { click_on access_type_name } within('.dropdown-menu.push') { click_on access_type_name }
end end
expect(page).to have_content "Updated protected branch" wait_for_ajax
expect(ProtectedBranch.last.allowed_to_push).to eq(access_type_id) expect(ProtectedBranch.last.allowed_to_push).to eq(access_type_id)
end end
end end
...@@ -140,7 +142,7 @@ feature 'Projected Branches', feature: true, js: true do ...@@ -140,7 +142,7 @@ feature 'Projected Branches', feature: true, js: true do
within('.dropdown-menu.merge') { click_on access_type_name } within('.dropdown-menu.merge') { click_on access_type_name }
end end
expect(page).to have_content "Updated protected branch" wait_for_ajax
expect(ProtectedBranch.last.allowed_to_merge).to eq(access_type_id) expect(ProtectedBranch.last.allowed_to_merge).to eq(access_type_id)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment