summaryrefslogtreecommitdiff
path: root/spec/presenters/tree_entry_presenter_spec.rb
blob: d29a7a6ab044a8de1c2fa2934c967d0fab1c138a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe TreeEntryPresenter do
  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
    it { expect(presenter.web_url).to eq("http://localhost/#{project.full_path}/-/tree/#{tree.commit_id}/#{tree.path}") }
  end
end