Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
93529874
Commit
93529874
authored
Sep 09, 2021
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove experiment word from continuous onboarding
Part of cleanup
parent
422d1187
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
16 deletions
+16
-16
app/controllers/projects/learn_gitlab_controller.rb
app/controllers/projects/learn_gitlab_controller.rb
+1
-1
app/helpers/learn_gitlab_helper.rb
app/helpers/learn_gitlab_helper.rb
+1
-1
app/helpers/sidebars_helper.rb
app/helpers/sidebars_helper.rb
+1
-1
lib/sidebars/projects/menus/learn_gitlab_menu.rb
lib/sidebars/projects/menus/learn_gitlab_menu.rb
+2
-2
spec/controllers/projects/learn_gitlab_controller_spec.rb
spec/controllers/projects/learn_gitlab_controller_spec.rb
+3
-3
spec/helpers/learn_gitlab_helper_spec.rb
spec/helpers/learn_gitlab_helper_spec.rb
+2
-2
spec/lib/sidebars/projects/menus/learn_gitlab_menu_spec.rb
spec/lib/sidebars/projects/menus/learn_gitlab_menu_spec.rb
+4
-4
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+2
-2
No files found.
app/controllers/projects/learn_gitlab_controller.rb
View file @
93529874
...
...
@@ -12,6 +12,6 @@ class Projects::LearnGitlabController < Projects::ApplicationController
private
def
check_experiment_enabled?
return
access_denied!
unless
helpers
.
learn_gitlab_e
xperiment_e
nabled?
(
project
)
return
access_denied!
unless
helpers
.
learn_gitlab_enabled?
(
project
)
end
end
app/helpers/learn_gitlab_helper.rb
View file @
93529874
# frozen_string_literal: true
module
LearnGitlabHelper
def
learn_gitlab_e
xperiment_e
nabled?
(
project
)
def
learn_gitlab_enabled?
(
project
)
return
false
unless
current_user
learn_gitlab_onboarding_available?
(
project
)
...
...
app/helpers/sidebars_helper.rb
View file @
93529874
...
...
@@ -87,7 +87,7 @@ module SidebarsHelper
{
current_user:
user
,
container:
project
,
learn_gitlab_e
xperiment_enabled:
learn_gitlab_experiment
_enabled?
(
project
),
learn_gitlab_e
nabled:
learn_gitlab
_enabled?
(
project
),
current_ref:
current_ref
,
jira_issues_integration:
project_jira_issues_integration?
,
can_view_pipeline_editor:
can_view_pipeline_editor?
(
project
),
...
...
lib/sidebars/projects/menus/learn_gitlab_menu.rb
View file @
93529874
...
...
@@ -23,7 +23,7 @@ module Sidebars
override
:has_pill?
def
has_pill?
context
.
learn_gitlab_e
xperiment_e
nabled
context
.
learn_gitlab_enabled
end
override
:pill_count
...
...
@@ -52,7 +52,7 @@ module Sidebars
override
:render?
def
render?
context
.
learn_gitlab_e
xperiment_e
nabled
context
.
learn_gitlab_enabled
end
end
end
...
...
spec/controllers/projects/learn_gitlab_controller_spec.rb
View file @
93529874
...
...
@@ -7,13 +7,13 @@ RSpec.describe Projects::LearnGitlabController do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:learn_gitlab_e
xperiment_e
nabled
)
{
true
}
let
(
:learn_gitlab_enabled
)
{
true
}
let
(
:params
)
{
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
}
subject
{
get
:index
,
params:
params
}
before
do
allow
(
controller
.
helpers
).
to
receive
(
:learn_gitlab_e
xperiment_enabled?
).
and_return
(
learn_gitlab_experiment
_enabled
)
allow
(
controller
.
helpers
).
to
receive
(
:learn_gitlab_e
nabled?
).
and_return
(
learn_gitlab
_enabled
)
end
context
'unauthenticated user'
do
...
...
@@ -28,7 +28,7 @@ RSpec.describe Projects::LearnGitlabController do
it
{
is_expected
.
to
render_template
(
:index
)
}
context
'learn_gitlab experiment not enabled'
do
let
(
:learn_gitlab_e
xperiment_e
nabled
)
{
false
}
let
(
:learn_gitlab_enabled
)
{
false
}
it
{
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
}
end
...
...
spec/helpers/learn_gitlab_helper_spec.rb
View file @
93529874
...
...
@@ -53,7 +53,7 @@ RSpec.describe LearnGitlabHelper do
end
end
describe
'.learn_gitlab_e
xperiment_e
nabled?'
do
describe
'.learn_gitlab_enabled?'
do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:user
)
{
create
(
:user
)
}
...
...
@@ -61,7 +61,7 @@ RSpec.describe LearnGitlabHelper do
let
(
:params
)
{
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
}
subject
{
helper
.
learn_gitlab_e
xperiment_e
nabled?
(
project
)
}
subject
{
helper
.
learn_gitlab_enabled?
(
project
)
}
where
(
:onboarding
,
:learn_gitlab_available
,
:result
)
do
true
|
true
|
true
...
...
spec/lib/sidebars/projects/menus/learn_gitlab_menu_spec.rb
View file @
93529874
...
...
@@ -4,13 +4,13 @@ require 'spec_helper'
RSpec
.
describe
Sidebars
::
Projects
::
Menus
::
LearnGitlabMenu
do
let_it_be
(
:project
)
{
build
(
:project
)
}
let_it_be
(
:
experiment
_enabled
)
{
true
}
let_it_be
(
:
learn_gitlab
_enabled
)
{
true
}
let
(
:context
)
do
Sidebars
::
Projects
::
Context
.
new
(
current_user:
nil
,
container:
project
,
learn_gitlab_e
xperiment_enabled:
experiment
_enabled
learn_gitlab_e
nabled:
learn_gitlab
_enabled
)
end
...
...
@@ -43,7 +43,7 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
end
context
'when learn gitlab experiment is disabled'
do
let
(
:
experiment
_enabled
)
{
false
}
let
(
:
learn_gitlab
_enabled
)
{
false
}
it
'returns false'
do
expect
(
subject
.
render?
).
to
eq
false
...
...
@@ -59,7 +59,7 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
end
context
'when learn gitlab experiment is disabled'
do
let
(
:
experiment
_enabled
)
{
false
}
let
(
:
learn_gitlab
_enabled
)
{
false
}
it
'returns false'
do
expect
(
subject
.
has_pill?
).
to
eq
false
...
...
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
93529874
...
...
@@ -68,8 +68,8 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end
describe
'Learn GitLab'
do
it
'has a link to the learn GitLab
experiment
'
do
allow
(
view
).
to
receive
(
:learn_gitlab_e
xperiment_e
nabled?
).
and_return
(
true
)
it
'has a link to the learn GitLab'
do
allow
(
view
).
to
receive
(
:learn_gitlab_enabled?
).
and_return
(
true
)
allow_next_instance_of
(
LearnGitlab
::
Onboarding
)
do
|
onboarding
|
expect
(
onboarding
).
to
receive
(
:completed_percentage
).
and_return
(
20
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment