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
91cd678b
Commit
91cd678b
authored
Oct 01, 2020
by
Amy Troschinetz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fix to make strategy spec faster
parent
89e0628e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
33 deletions
+1
-33
spec/models/operations/feature_flags/strategy_spec.rb
spec/models/operations/feature_flags/strategy_spec.rb
+1
-33
No files found.
spec/models/operations/feature_flags/strategy_spec.rb
View file @
91cd678b
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Operations
::
FeatureFlags
::
Strategy
do
RSpec
.
describe
Operations
::
FeatureFlags
::
Strategy
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:feature_flag
)
{
create
(
:operations_feature_flag
,
project:
project
)
}
describe
'validations'
do
describe
'validations'
do
it
do
it
do
...
@@ -19,7 +20,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -19,7 +20,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'skips parameters validation'
do
it
'skips parameters validation'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
invalid_name
,
parameters:
{
bad:
'params'
})
name:
invalid_name
,
parameters:
{
bad:
'params'
})
...
@@ -36,7 +36,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -36,7 +36,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must have valid parameters for the strategy'
do
it
'must have valid parameters for the strategy'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
parameters:
invalid_parameters
)
name:
'gradualRolloutUserId'
,
parameters:
invalid_parameters
)
...
@@ -45,7 +44,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -45,7 +44,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'allows the parameters in any order'
do
it
'allows the parameters in any order'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
parameters:
{
percentage:
'10'
,
groupId:
'mygroup'
})
parameters:
{
percentage:
'10'
,
groupId:
'mygroup'
})
...
@@ -61,7 +59,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -61,7 +59,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
parameters:
{
groupId:
'mygroup'
,
percentage:
invalid_value
})
parameters:
{
groupId:
'mygroup'
,
percentage:
invalid_value
})
...
@@ -75,7 +72,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -75,7 +72,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
parameters:
{
groupId:
'mygroup'
,
percentage:
valid_value
})
parameters:
{
groupId:
'mygroup'
,
percentage:
valid_value
})
...
@@ -92,7 +88,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -92,7 +88,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must be a string value of up to 32 lowercase characters'
do
it
'must be a string value of up to 32 lowercase characters'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
parameters:
{
groupId:
invalid_value
,
percentage:
'40'
})
parameters:
{
groupId:
invalid_value
,
percentage:
'40'
})
...
@@ -106,7 +101,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -106,7 +101,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must be a string value of up to 32 lowercase characters'
do
it
'must be a string value of up to 32 lowercase characters'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
parameters:
{
groupId:
valid_value
,
percentage:
'40'
})
parameters:
{
groupId:
valid_value
,
percentage:
'40'
})
...
@@ -129,7 +123,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -129,7 +123,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
])
])
with_them
do
with_them
do
it
'must have valid parameters for the strategy'
do
it
'must have valid parameters for the strategy'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
parameters:
invalid_parameters
)
parameters:
invalid_parameters
)
...
@@ -144,7 +137,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -144,7 +137,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
[
:groupId
,
'mygroup'
]
[
:groupId
,
'mygroup'
]
].
permutation
(
3
).
each
do
|
parameters
|
].
permutation
(
3
).
each
do
|
parameters
|
it
"allows the parameters in the order
#{
parameters
.
map
{
|
p
|
p
.
first
}
.join(', ')}"
do
it
"allows the parameters in the order
#{
parameters
.
map
{
|
p
|
p
.
first
}
.join(', ')}"
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
parameters:
Hash
[
parameters
])
parameters:
Hash
[
parameters
])
...
@@ -159,7 +151,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -159,7 +151,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
"
\n
"
,
"
\t
"
,
"
\n
10"
,
"20
\n
"
,
"
\n
100"
,
"100
\n
"
,
"
\n
"
,
nil
])
"
\n
"
,
"
\t
"
,
"
\n
10"
,
"20
\n
"
,
"
\n
100"
,
"100
\n
"
,
"
\n
"
,
nil
])
with_them
do
with_them
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
'mygroup'
,
rollout:
invalid_value
}
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
'mygroup'
,
rollout:
invalid_value
}
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -174,7 +165,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -174,7 +165,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
where
(
valid_value:
%w[0 1 10 38 100 93]
)
where
(
valid_value:
%w[0 1 10 38 100 93]
)
with_them
do
with_them
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
it
'must be a string value between 0 and 100 inclusive and without a percentage sign'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
'mygroup'
,
rollout:
valid_value
}
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
'mygroup'
,
rollout:
valid_value
}
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -190,7 +180,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -190,7 +180,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
'!bad'
,
'.bad'
,
'Bad'
,
'bad1'
,
""
,
" "
,
"b"
*
33
,
"ba_d"
,
"ba
\n
d"
])
'!bad'
,
'.bad'
,
'Bad'
,
'bad1'
,
""
,
" "
,
"b"
*
33
,
"ba_d"
,
"ba
\n
d"
])
with_them
do
with_them
do
it
'must be a string value of up to 32 lowercase characters'
do
it
'must be a string value of up to 32 lowercase characters'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
invalid_value
,
rollout:
'40'
}
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
invalid_value
,
rollout:
'40'
}
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -203,7 +192,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -203,7 +192,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
where
(
valid_value:
[
"somegroup"
,
"anothergroup"
,
"okay"
,
"g"
,
"a"
*
32
])
where
(
valid_value:
[
"somegroup"
,
"anothergroup"
,
"okay"
,
"g"
,
"a"
*
32
])
with_them
do
with_them
do
it
'must be a string value of up to 32 lowercase characters'
do
it
'must be a string value of up to 32 lowercase characters'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
valid_value
,
rollout:
'40'
}
parameters
=
{
stickiness:
'DEFAULT'
,
groupId:
valid_value
,
rollout:
'40'
}
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -218,7 +206,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -218,7 +206,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
where
(
invalid_value:
[
nil
,
" "
,
"default"
,
"DEFAULT
\n
"
,
"UserId"
,
"USER"
,
"USERID "
])
where
(
invalid_value:
[
nil
,
" "
,
"default"
,
"DEFAULT
\n
"
,
"UserId"
,
"USER"
,
"USERID "
])
with_them
do
with_them
do
it
'must be a string representing a supported stickiness setting'
do
it
'must be a string representing a supported stickiness setting'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
parameters
=
{
stickiness:
invalid_value
,
groupId:
'mygroup'
,
rollout:
'40'
}
parameters
=
{
stickiness:
invalid_value
,
groupId:
'mygroup'
,
rollout:
'40'
}
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -233,7 +220,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -233,7 +220,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
where
(
valid_value:
%w[DEFAULT USERID SESSIONID RANDOM]
)
where
(
valid_value:
%w[DEFAULT USERID SESSIONID RANDOM]
)
with_them
do
with_them
do
it
'must be a string representing a supported stickiness setting'
do
it
'must be a string representing a supported stickiness setting'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
parameters
=
{
stickiness:
valid_value
,
groupId:
'mygroup'
,
rollout:
'40'
}
parameters
=
{
stickiness:
valid_value
,
groupId:
'mygroup'
,
rollout:
'40'
}
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -251,7 +237,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -251,7 +237,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must have valid parameters for the strategy'
do
it
'must have valid parameters for the strategy'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'userWithId'
,
parameters:
invalid_parameters
)
name:
'userWithId'
,
parameters:
invalid_parameters
)
...
@@ -268,7 +253,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -268,7 +253,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'is valid with a string of comma separated values'
do
it
'is valid with a string of comma separated values'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'userWithId'
,
parameters:
{
userIds:
valid_value
})
name:
'userWithId'
,
parameters:
{
userIds:
valid_value
})
...
@@ -283,7 +267,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -283,7 +267,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'is invalid'
do
it
'is invalid'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'userWithId'
,
parameters:
{
userIds:
invalid_value
})
name:
'userWithId'
,
parameters:
{
userIds:
invalid_value
})
...
@@ -301,7 +284,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -301,7 +284,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must be empty'
do
it
'must be empty'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'default'
,
name:
'default'
,
parameters:
invalid_value
)
parameters:
invalid_value
)
...
@@ -311,7 +293,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -311,7 +293,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'must be empty'
do
it
'must be empty'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'default'
,
name:
'default'
,
parameters:
{})
parameters:
{})
...
@@ -326,7 +307,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -326,7 +307,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
with_them
do
with_them
do
it
'must be empty'
do
it
'must be empty'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gitlabUserList'
,
name:
'gitlabUserList'
,
parameters:
invalid_value
)
parameters:
invalid_value
)
...
@@ -336,7 +316,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -336,7 +316,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'must be empty'
do
it
'must be empty'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gitlabUserList'
,
name:
'gitlabUserList'
,
parameters:
{})
parameters:
{})
...
@@ -349,7 +328,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -349,7 +328,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
describe
'associations'
do
describe
'associations'
do
context
'when name is gitlabUserList'
do
context
'when name is gitlabUserList'
do
it
'is valid when associated with a user list'
do
it
'is valid when associated with a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gitlabUserList'
,
name:
'gitlabUserList'
,
...
@@ -360,7 +338,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -360,7 +338,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'is invalid without a user list'
do
it
'is invalid without a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gitlabUserList'
,
name:
'gitlabUserList'
,
parameters:
{})
parameters:
{})
...
@@ -370,7 +347,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -370,7 +347,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
it
'is invalid when associated with a user list from another project'
do
it
'is invalid when associated with a user list from another project'
do
other_project
=
create
(
:project
)
other_project
=
create
(
:project
)
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
other_project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
other_project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gitlabUserList'
,
name:
'gitlabUserList'
,
...
@@ -383,7 +359,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -383,7 +359,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
context
'when name is default'
do
context
'when name is default'
do
it
'is invalid when associated with a user list'
do
it
'is invalid when associated with a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'default'
,
name:
'default'
,
...
@@ -394,7 +369,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -394,7 +369,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'is valid without a user list'
do
it
'is valid without a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'default'
,
name:
'default'
,
parameters:
{})
parameters:
{})
...
@@ -405,7 +379,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -405,7 +379,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
context
'when name is userWithId'
do
context
'when name is userWithId'
do
it
'is invalid when associated with a user list'
do
it
'is invalid when associated with a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'userWithId'
,
name:
'userWithId'
,
...
@@ -416,7 +389,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -416,7 +389,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'is valid without a user list'
do
it
'is valid without a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'userWithId'
,
name:
'userWithId'
,
parameters:
{
userIds:
'user1'
})
parameters:
{
userIds:
'user1'
})
...
@@ -427,7 +399,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -427,7 +399,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
context
'when name is gradualRolloutUserId'
do
context
'when name is gradualRolloutUserId'
do
it
'is invalid when associated with a user list'
do
it
'is invalid when associated with a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
...
@@ -438,7 +409,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -438,7 +409,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'is valid without a user list'
do
it
'is valid without a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'gradualRolloutUserId'
,
name:
'gradualRolloutUserId'
,
parameters:
{
groupId:
'default'
,
percentage:
'10'
})
parameters:
{
groupId:
'default'
,
percentage:
'10'
})
...
@@ -449,7 +419,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -449,7 +419,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
context
'when name is flexibleRollout'
do
context
'when name is flexibleRollout'
do
it
'is invalid when associated with a user list'
do
it
'is invalid when associated with a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
user_list
=
create
(
:operations_feature_flag_user_list
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
...
@@ -462,7 +431,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
...
@@ -462,7 +431,6 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
end
it
'is valid without a user list'
do
it
'is valid without a user list'
do
feature_flag
=
create
(
:operations_feature_flag
,
project:
project
)
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
strategy
=
described_class
.
create
(
feature_flag:
feature_flag
,
name:
'flexibleRollout'
,
name:
'flexibleRollout'
,
parameters:
{
groupId:
'default'
,
parameters:
{
groupId:
'default'
,
...
...
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