Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/tree_helper_spec.rb')
-rw-r--r--spec/helpers/tree_helper_spec.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/helpers/tree_helper_spec.rb b/spec/helpers/tree_helper_spec.rb
index bc25a2fcdfc..1a0ecd5d903 100644
--- a/spec/helpers/tree_helper_spec.rb
+++ b/spec/helpers/tree_helper_spec.rb
@@ -84,14 +84,21 @@ RSpec.describe TreeHelper do
describe '#web_ide_button_data' do
let(:blob) { project.repository.blob_at('refs/heads/master', @path) }
+ let_it_be(:user_preferences_gitpod_path) { '/-/profile/preferences#user_gitpod_enabled' }
+ let_it_be(:user_profile_enable_gitpod_path) { '/-/profile?user%5Bgitpod_enabled%5D=true' }
+
before do
@path = ''
@project = project
@ref = sha
- allow(helper).to receive(:current_user).and_return(nil)
- allow(helper).to receive(:can_collaborate_with_project?).and_return(true)
- allow(helper).to receive(:can?).and_return(true)
+ allow(helper).to receive_messages(
+ current_user: nil,
+ can_collaborate_with_project?: true,
+ can?: true,
+ user_preferences_gitpod_path: user_preferences_gitpod_path,
+ user_profile_enable_gitpod_path: user_profile_enable_gitpod_path
+ )
end
subject { helper.web_ide_button_data(blob: blob) }
@@ -112,7 +119,10 @@ RSpec.describe TreeHelper do
edit_url: '',
web_ide_url: "/-/ide/project/#{project.full_path}/edit/#{sha}",
- gitpod_url: ''
+
+ gitpod_url: '',
+ user_preferences_gitpod_path: user_preferences_gitpod_path,
+ user_profile_enable_gitpod_path: user_profile_enable_gitpod_path
)
end