diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-25 16:48:21 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-25 16:48:21 +0300 |
commit | 4b1475b90851eb1e9ff9103fc0247d2d2e45d52e (patch) | |
tree | 977f04a1e390281fe3ca68e78ed01125e9510e18 /spec/helpers/blob_helper_spec.rb | |
parent | 0ad5fdeda5c231ab678a94a2009da4f440ed43be (diff) |
added helper spec
Diffstat (limited to 'spec/helpers/blob_helper_spec.rb')
-rw-r--r-- | spec/helpers/blob_helper_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb index 1fa194fe1b8..750734be290 100644 --- a/spec/helpers/blob_helper_spec.rb +++ b/spec/helpers/blob_helper_spec.rb @@ -242,4 +242,18 @@ describe BlobHelper do end end end + + describe '#ide_edit_path' do + let(:project) { create(:project) } + + it 'returns full IDE path' do + expect(helper.ide_edit_path(project, "master", "")).to eq("/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master/") + end + + it 'returns IDE path without relative_url_root' do + Rails.application.routes.default_url_options[:script_name] = "/gitlab" + + expect(helper.ide_edit_path(project, "master", "")).to eq("/gitlab/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master/") + end + end end |