diff options
-rw-r--r-- | app/views/projects/protected_branches/index.html.haml | 26 | ||||
-rw-r--r-- | spec/features/protected_branches_spec.rb | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml index 69caed7d979..75c2063027a 100644 --- a/app/views/projects/protected_branches/index.html.haml +++ b/app/views/projects/protected_branches/index.html.haml @@ -32,22 +32,20 @@ are supported. .form-group - .prepend-left-10 - = f.hidden_field :allowed_to_merge - = f.label :allowed_to_merge, "Allowed to merge: ", class: "label-light append-bottom-0" - = dropdown_tag("<Make a selection>", - options: { title: "Allowed to merge", toggle_class: 'allowed-to-merge', - dropdown_class: 'dropdown-menu-selectable', - data: { field_name: "protected_branch[allowed_to_merge]" }}) + = f.hidden_field :allowed_to_merge + = f.label :allowed_to_merge, "Allowed to merge: ", class: "label-light append-bottom-0" + = dropdown_tag("<Make a selection>", + options: { title: "Allowed to merge", toggle_class: 'allowed-to-merge', + dropdown_class: 'dropdown-menu-selectable', + data: { field_name: "protected_branch[allowed_to_merge]" }}) .form-group - .prepend-left-10 - = f.hidden_field :allowed_to_push - = f.label :allowed_to_push, "Allowed to push: ", class: "label-light append-bottom-0" - = dropdown_tag("<Make a selection>", - options: { title: "Allowed to push", toggle_class: 'allowed-to-push', - dropdown_class: 'dropdown-menu-selectable', - data: { field_name: "protected_branch[allowed_to_push]" }}) + = f.hidden_field :allowed_to_push + = f.label :allowed_to_push, "Allowed to push: ", class: "label-light append-bottom-0" + = dropdown_tag("<Make a selection>", + options: { title: "Allowed to push", toggle_class: 'allowed-to-push', + dropdown_class: 'dropdown-menu-selectable', + data: { field_name: "protected_branch[allowed_to_push]" }}) = f.submit "Protect", class: "btn-create btn protect-branch-btn", disabled: true diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb index d72b62a4962..dac2bcf9efd 100644 --- a/spec/features/protected_branches_spec.rb +++ b/spec/features/protected_branches_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' feature 'Projected Branches', feature: true, js: true do + include WaitForAjax + let(:user) { create(:user, :admin) } let(:project) { create(:project) } @@ -109,7 +111,7 @@ feature 'Projected Branches', feature: true, js: true do within('.dropdown-menu.push') { click_on access_type_name } end - expect(page).to have_content "Updated protected branch" + wait_for_ajax expect(ProtectedBranch.last.allowed_to_push).to eq(access_type_id) end end @@ -140,7 +142,7 @@ feature 'Projected Branches', feature: true, js: true do within('.dropdown-menu.merge') { click_on access_type_name } end - expect(page).to have_content "Updated protected branch" + wait_for_ajax expect(ProtectedBranch.last.allowed_to_merge).to eq(access_type_id) end end |