Commit 2ea23f76 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'fix/gb/notification-settings-when-no-repository' into 'master'

Show notifications settings even when repository feature is disabled

See merge request !9180
parents ea9e0372 ffc041ac
...@@ -28,9 +28,11 @@ ...@@ -28,9 +28,11 @@
.project-clone-holder .project-clone-holder
= render "shared/clone_panel" = render "shared/clone_panel"
- if current_user && can?(current_user, :download_code, @project) - if current_user
- if can?(current_user, :download_code, @project)
= render 'projects/buttons/download', project: @project, ref: @ref = render 'projects/buttons/download', project: @project, ref: @ref
= render 'projects/buttons/dropdown' = render 'projects/buttons/dropdown'
= render 'shared/notifications/button', notification_setting: @notification_setting
= render 'projects/buttons/koding' = render 'projects/buttons/koding'
= render 'shared/notifications/button', notification_setting: @notification_setting
= render 'shared/members/access_request_buttons', source: @project = render 'shared/members/access_request_buttons', source: @project
---
title: Show notifications settings dropdown even if repository feature is disabled
merge_request: 9180
author:
require 'spec_helper'
describe 'projects/_home_panel', :view do
let(:project) { create(:empty_project, :public) }
let(:notification_settings) do
user.notification_settings_for(project) if user
end
before do
assign(:project, project)
assign(:notification_setting, notification_settings)
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:can?).and_return(false)
end
context 'when user is signed in' do
let(:user) { create(:user) }
it 'makes it possible to set notification level' do
render
expect(view).to render_template('shared/notifications/_button')
expect(rendered).to have_selector('.notification-dropdown')
end
end
context 'when user is signed out' do
let(:user) { nil }
it 'is not possible to set notification level' do
render
expect(rendered).not_to have_selector('.notification_dropdown')
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