diff options
Diffstat (limited to 'spec/presenters/tree_entry_presenter_spec.rb')
-rw-r--r-- | spec/presenters/tree_entry_presenter_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/presenters/tree_entry_presenter_spec.rb b/spec/presenters/tree_entry_presenter_spec.rb new file mode 100644 index 00000000000..d74ee5dc28f --- /dev/null +++ b/spec/presenters/tree_entry_presenter_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +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 |