summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-02-08 14:12:44 +0100
committerJames Lopez <james@jameslopez.es>2018-02-23 14:01:38 +0100
commit9053f8eb4b94669d18674552b8f588071d8c76c6 (patch)
tree4f3108ec1fb7002f9d3b3f4dcaaa27572e29a9ba /app/helpers
parentb8d7367ad0049dd3cb230d3439831037c4c25ed0 (diff)
downloadgitlab-ce-9053f8eb4b94669d18674552b8f588071d8c76c6.tar.gz
fix specs
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/blob_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 16b9be9a916..8546e72a8a9 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -17,7 +17,7 @@ module BlobHelper
end
def edit_blob_link(project = @project, ref = @ref, path = @path, options = {})
- return unless readable_blob?(options, path, project, ref)
+ return unless blob = readable_blob(options, path, project, ref)
common_classes = "btn js-edit-blob #{options[:extra_class]}"
@@ -45,7 +45,7 @@ module BlobHelper
def ide_blob_link(project = @project, ref = @ref, path = @path, options = {})
return unless show_new_ide?
- return unless readable_blob?(options, path, project, ref)
+ return unless blob = readable_blob(options, path, project, ref)
common_classes = "btn js-edit-ide #{options[:extra_class]}"
@@ -304,11 +304,11 @@ module BlobHelper
options
end
- def readable_blob?(options, path, project, ref)
+ def readable_blob(options, path, project, ref)
blob = options.delete(:blob)
blob ||= project.repository.blob_at(ref, path) rescue nil
- blob && blob.readable_text?
+ blob if blob&.readable_text?
end
def edit_blob_fork(common_classes, options, path, project, ref)