2019-06-04 13:38:18 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 06:09:01 +00:00
|
|
|
RSpec.describe TreeEntryPresenter do
|
2019-06-04 13:38:18 +00:00
|
|
|
include Gitlab::Routing.url_helpers
|
|
|
|
|
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
let(:repository) { project.repository }
|
|
|
|
let(:tree) { Gitlab::Graphql::Representation::TreeEntry.new(repository.tree.trees.first, repository) }
|
|
|
|
let(:presenter) { described_class.new(tree) }
|
|
|
|
|
|
|
|
describe '.web_url' do
|
2020-01-27 12:08:35 +00:00
|
|
|
it { expect(presenter.web_url).to eq("http://localhost/#{project.full_path}/-/tree/#{tree.commit_id}/#{tree.path}") }
|
2019-06-04 13:38:18 +00:00
|
|
|
end
|
|
|
|
end
|