Commit 003a645a authored by manojmj's avatar manojmj

Revert "Fix bug in group security dashboard"

This reverts commit 627dfde1272ef142474e08e1a395d968d1ad8b1e.
parent 52ea9097
......@@ -2,7 +2,7 @@
module Groups::SecurityFeaturesHelper
def group_level_security_dashboard_available?(group)
can?(current_user, :read_group_security_dashboard, group)
group.feature_available?(:security_dashboard)
end
def group_level_compliance_dashboard_available?(group)
......
......@@ -9,19 +9,18 @@ RSpec.describe Groups::SecurityFeaturesHelper do
let_it_be(:user, refind: true) { create(:user) }
before do
allow(helper).to receive(:can?) { |*args| Ability.allowed?(*args) }
allow(helper).to receive(:current_user).and_return(user)
end
describe '#group_level_security_dashboard_available?' do
where(:read_group_security_dashboard_permission, :result) do
false | false
where(:security_dashboard_feature_enabled, :result) do
true | true
false | false
end
with_them do
before do
allow(helper).to receive(:can?).with(user, :read_group_security_dashboard, group).and_return(read_group_security_dashboard_permission)
stub_licensed_features(security_dashboard: security_dashboard_feature_enabled)
end
it 'returns the expected result' do
......
......@@ -109,18 +109,11 @@ RSpec.describe 'layouts/nav/sidebar/_group' do
stub_licensed_features(security_dashboard: true)
end
context 'when the user has access to Compliance dashboard' do
before do
group.add_developer(user)
allow(view).to receive(:current_user).and_return(user)
end
it 'is visible' do
render
it 'is visible' do
render
expect(rendered).to have_link 'Security & Compliance'
expect(rendered).to have_link 'Security'
end
expect(rendered).to have_link 'Security & Compliance'
expect(rendered).to have_link 'Security'
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