Commit 5d24ce8b authored by Timothy Andrew's avatar Timothy Andrew Committed by Alfredo Sumaran

Address final round of comments from @DouweM.

1. No need to change the spec for `UserAccess#can_push_to_branch?` for
   EE anymore.

2. Make the `dropdowns_helper` change additive to CE, so as to reduce
   the potential for merge conflicts.
parent a5415634
...@@ -7,10 +7,10 @@ module DropdownsHelper ...@@ -7,10 +7,10 @@ module DropdownsHelper
data_attr = options[:data].merge(data_attr) data_attr = options[:data].merge(data_attr)
end end
dropdown_output = dropdown_toggle(toggle_text, data_attr, options)
if options.has_key?(:toggle_link) if options.has_key?(:toggle_link)
dropdown_output = dropdown_toggle_link(toggle_text, data_attr, options) dropdown_output = dropdown_toggle_link(toggle_text, data_attr, options)
else
dropdown_output = dropdown_toggle(toggle_text, data_attr, options)
end end
dropdown_output << content_tag(:div, class: "dropdown-menu dropdown-select #{options[:dropdown_class] if options.has_key?(:dropdown_class)}") do dropdown_output << content_tag(:div, class: "dropdown-menu dropdown-select #{options[:dropdown_class] if options.has_key?(:dropdown_class)}") do
......
...@@ -66,12 +66,12 @@ describe Gitlab::UserAccess, lib: true do ...@@ -66,12 +66,12 @@ describe Gitlab::UserAccess, lib: true do
end end
describe 'push to protected branch' do describe 'push to protected branch' do
let(:branch) { create :protected_branch, :remove_default_access_levels, project: project } let(:branch) { create :protected_branch, project: project }
it 'returns false if user is a master' do it 'returns true if user is a master' do
project.team << [user, :master] project.team << [user, :master]
expect(access.can_push_to_branch?(branch.name)).to be_falsy expect(access.can_push_to_branch?(branch.name)).to be_truthy
end end
it 'returns false if user is a developer' do it 'returns false if user is a developer' do
......
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