Commit a0cd769e authored by a_luna's avatar a_luna

Address code review comments

- Improve variable name
- Add Changelog
- Remove unnecessary let_it_be
parent e54ac90d
...@@ -39,8 +39,8 @@ class SnippetBlobPresenter < BlobPresenter ...@@ -39,8 +39,8 @@ class SnippetBlobPresenter < BlobPresenter
end end
def renderer def renderer
proxy = Warden::Proxy.new({}, Warden::Manager.new({})).tap do |i| proxy = Warden::Proxy.new({}, Warden::Manager.new({})).tap do |proxy_instance|
i.set_user(current_user, scope: :user) proxy_instance.set_user(current_user, scope: :user)
end end
ApplicationController.renderer.new('warden' => proxy) ApplicationController.renderer.new('warden' => proxy)
......
---
title: Fix snippet blob viewers for rich and plain data
merge_request: 25945
author:
type: fixed
...@@ -4,8 +4,6 @@ require 'spec_helper' ...@@ -4,8 +4,6 @@ require 'spec_helper'
describe SnippetBlobPresenter do describe SnippetBlobPresenter do
describe '#rich_data' do describe '#rich_data' do
let_it_be(:snippet) { create(:personal_snippet) }
before do before do
allow_next_instance_of(described_class) do |instance| allow_next_instance_of(described_class) do |instance|
allow(instance).to receive(:current_user).and_return(nil) allow(instance).to receive(:current_user).and_return(nil)
......
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