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 index de84f36c5e6..0abf372b704 100644 --- a/spec/presenters/tree_entry_presenter_spec.rb +++ b/spec/presenters/tree_entry_presenter_spec.rb @@ -17,4 +17,20 @@ RSpec.describe TreeEntryPresenter do describe '#web_path' do it { expect(presenter.web_path).to eq("/#{project.full_path}/-/tree/#{tree.commit_id}/#{tree.path}") } end + + context 'when blob has ref_type' do + before do + tree.ref_type = 'heads' + end + + describe '.web_url' do + it { expect(presenter.web_url).to eq("http://localhost/#{project.full_path}/-/tree/#{tree.commit_id}/#{tree.path}?ref_type=heads") } + end + + describe '#web_path' do + it { + expect(presenter.web_path).to eq("/#{project.full_path}/-/tree/#{tree.commit_id}/#{tree.path}?ref_type=heads") + } + end + end end |