2020-06-22 08:08:47 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module SnippetHelpers
|
|
|
|
def sign_in_as(user)
|
|
|
|
sign_in(public_send(user)) if user
|
|
|
|
end
|
2020-07-01 11:08:45 -04:00
|
|
|
|
|
|
|
def snippet_blob_file(blob)
|
|
|
|
{
|
|
|
|
"path" => blob.path,
|
2020-10-06 05:08:32 -04:00
|
|
|
"raw_url" => gitlab_raw_snippet_blob_url(blob.container, blob.path, host: 'localhost')
|
2020-07-01 11:08:45 -04:00
|
|
|
}
|
|
|
|
end
|
2020-06-22 08:08:47 -04:00
|
|
|
end
|