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
7098c3a8
Commit
7098c3a8
authored
Oct 01, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First round of spec updates
parent
65891560
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
1 deletion
+43
-1
ee/app/helpers/ee/projects_helper.rb
ee/app/helpers/ee/projects_helper.rb
+1
-1
ee/spec/factories/operations/feature_flags.rb
ee/spec/factories/operations/feature_flags.rb
+7
-0
ee/spec/factories/operations/feature_flags_access_tokens.rb
ee/spec/factories/operations/feature_flags_access_tokens.rb
+5
-0
ee/spec/lib/gitlab/regex_spec.rb
ee/spec/lib/gitlab/regex_spec.rb
+10
-0
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+20
-0
No files found.
ee/app/helpers/ee/projects_helper.rb
View file @
7098c3a8
...
@@ -35,7 +35,7 @@ module EE
...
@@ -35,7 +35,7 @@ module EE
override
:tab_ability_map
override
:tab_ability_map
def
tab_ability_map
def
tab_ability_map
tab_ability_map
=
super
tab_ability_map
=
super
tab_ability_map
[
:feature_flags
]
=
read_feature_flags
tab_ability_map
[
:feature_flags
]
=
:
read_feature_flags
tab_ability_map
tab_ability_map
end
end
...
...
ee/spec/factories/operations/feature_flags.rb
0 → 100644
View file @
7098c3a8
FactoryBot
.
define
do
factory
:operations_feature_flag
,
class:
Operations
::
FeatureFlag
do
sequence
(
:name
)
{
|
n
|
"feature_flag_
#{
n
}
"
}
project
active
true
end
end
ee/spec/factories/operations/feature_flags_access_tokens.rb
0 → 100644
View file @
7098c3a8
FactoryBot
.
define
do
factory
:operations_feature_flags_access_token
,
class:
Operations
::
FeatureFlagsAccessToken
do
project
end
end
ee/spec/lib/gitlab/regex_spec.rb
View file @
7098c3a8
...
@@ -9,4 +9,14 @@ describe Gitlab::Regex do
...
@@ -9,4 +9,14 @@ describe Gitlab::Regex do
it
{
is_expected
.
to
match
(
'foo*Z'
)
}
it
{
is_expected
.
to
match
(
'foo*Z'
)
}
it
{
is_expected
.
not_to
match
(
'!!()()'
)
}
it
{
is_expected
.
not_to
match
(
'!!()()'
)
}
end
end
describe
'.feature_flag_regex'
do
subject
{
described_class
.
feature_flag_regex
}
it
{
is_expected
.
to
match
(
'foo'
)
}
it
{
is_expected
.
to
match
(
'f_feature_flag'
)
}
it
{
is_expected
.
not_to
match
(
'MY_FEATURE_FLAG'
)
}
it
{
is_expected
.
not_to
match
(
'my feature flag'
)
}
it
{
is_expected
.
not_to
match
(
'!!()()'
)
}
end
end
end
ee/spec/models/project_spec.rb
View file @
7098c3a8
...
@@ -1767,4 +1767,24 @@ describe Project do
...
@@ -1767,4 +1767,24 @@ describe Project do
.
and_return
(
ref
)
.
and_return
(
ref
)
end
end
end
end
describe
'#feature_flag_access_token'
do
let
(
:project
)
{
create
(
:project
)
}
subject
{
project
.
feature_flag_access_token
}
context
'when there is no access token'
do
it
"creates a new one"
do
is_expected
.
not_to
be_empty
end
end
context
'when there is access token'
do
let!
(
:access_token
)
{
create
(
:operations_feature_flags_access_token
,
project:
project
,
token:
'token'
)
}
it
"provides an existing one"
do
is_expected
.
to
eq
(
'token'
)
end
end
end
end
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