Improve home panel partial code and view specs

This commit is contained in:
Grzegorz Bizon 2017-02-13 09:45:10 +01:00
parent 1f94b952b5
commit d1d5e2388d
2 changed files with 7 additions and 7 deletions

View file

@ -28,11 +28,11 @@
.project-clone-holder
= render "shared/clone_panel"
- if current_user && can?(current_user, :download_code, @project)
= render 'projects/buttons/download', project: @project, ref: @ref
= render 'projects/buttons/dropdown'
= render 'projects/buttons/koding'
- if current_user
- if can?(current_user, :download_code, @project)
= render 'projects/buttons/download', project: @project, ref: @ref
= render 'projects/buttons/dropdown'
= render 'projects/buttons/koding'
= render 'shared/notifications/button', notification_setting: @notification_setting
= render 'shared/members/access_request_buttons', source: @project

View file

@ -15,7 +15,7 @@ describe 'projects/_home_panel', :view do
allow(view).to receive(:can?).and_return(false)
end
context 'user is signed in' do
context 'when user is signed in' do
let(:user) { create(:user) }
it 'makes it possible to set notification level' do
@ -26,7 +26,7 @@ describe 'projects/_home_panel', :view do
end
end
context 'user is signed out' do
context 'when user is signed out' do
let(:user) { nil }
it 'is not possible to set notification level' do