Commit 883d1dab authored by Stan Hu's avatar Stan Hu

Fix spec failures with namespace helpers

parent 972b0c4c
...@@ -9,7 +9,7 @@ module NamespacesHelper ...@@ -9,7 +9,7 @@ module NamespacesHelper
.includes(:route) .includes(:route)
.order('routes.path') .order('routes.path')
users = [current_user.namespace] users = [current_user.namespace]
selected_id = current_user.namespace.id selected_id = selected
unless extra_group.nil? || extra_group.is_a?(Group) unless extra_group.nil? || extra_group.is_a?(Group)
extra_group = Group.find(extra_group) if Namespace.find(extra_group).kind == 'group' extra_group = Group.find(extra_group) if Namespace.find(extra_group).kind == 'group'
...@@ -25,7 +25,7 @@ module NamespacesHelper ...@@ -25,7 +25,7 @@ module NamespacesHelper
if Ability.allowed?(current_user, :read_group, extra_group) if Ability.allowed?(current_user, :read_group, extra_group)
# Assign the value to an invalid primary ID so that the select box works # Assign the value to an invalid primary ID so that the select box works
extra_group.id = -1 if !extra_group.persisted? extra_group.id = -1 unless extra_group.persisted?
selected_id = extra_group.id if selected == :extra_group selected_id = extra_group.id if selected == :extra_group
groups |= [extra_group] groups |= [extra_group]
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