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
17f79af7
Commit
17f79af7
authored
Mar 05, 2020
by
Pavel Shutsin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user_type and bot_type consistency tests
No need to rely on comment warning when we can do automated check
parent
da12adf9
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
12 deletions
+42
-12
app/models/user_bot_type_enums.rb
app/models/user_bot_type_enums.rb
+0
-3
app/models/user_type_enums.rb
app/models/user_type_enums.rb
+0
-3
ee/app/models/ee/user_bot_type_enums.rb
ee/app/models/ee/user_bot_type_enums.rb
+0
-3
ee/app/models/ee/user_type_enums.rb
ee/app/models/ee/user_type_enums.rb
+0
-3
ee/spec/models/ee/user_bot_type_enums_spec.rb
ee/spec/models/ee/user_bot_type_enums_spec.rb
+21
-0
ee/spec/models/ee/user_type_enums_spec.rb
ee/spec/models/ee/user_type_enums_spec.rb
+21
-0
No files found.
app/models/user_bot_type_enums.rb
View file @
17f79af7
...
...
@@ -2,9 +2,6 @@
module
UserBotTypeEnums
def
self
.
bots
# When adding a new key, please ensure you are not conflicting
# with EE-only keys in app/models/user_type_enums.rb
# or app/models/user_bot_type_enums.rb
{
alert_bot:
2
}
...
...
app/models/user_type_enums.rb
View file @
17f79af7
...
...
@@ -2,9 +2,6 @@
module
UserTypeEnums
def
self
.
types
# When adding a new key, please ensure you are not conflicting
# with EE-only keys in app/models/user_type_enums.rb
# or app/models/user_bot_type_enums.rb
bots
end
...
...
ee/app/models/ee/user_bot_type_enums.rb
View file @
17f79af7
...
...
@@ -9,9 +9,6 @@ module EE
override
:bots
def
bots
# When adding a new key, please ensure you are not conflicting
# with EE-only keys in app/models/user_type_enums.rb
# or app/models/user_bot_type_enums.rb
super
.
merge
(
support_bot:
1
,
visual_review_bot:
3
...
...
ee/app/models/ee/user_type_enums.rb
View file @
17f79af7
...
...
@@ -9,9 +9,6 @@ module EE
override
:types
def
types
# When adding a new key, please ensure you are not conflicting
# with EE-only keys in app/models/user_type_enums.rb
# or app/models/user_bot_type_enums.rb
super
.
merge
(
ServiceUser
:
4
)
end
...
...
ee/spec/models/ee/user_bot_type_enums_spec.rb
0 → 100644
View file @
17f79af7
# frozen_string_literal: true
require
'spec_helper'
describe
UserBotTypeEnums
do
it
'has no type conflicts between CE and EE'
,
:aggregate_failures
do
described_class
.
public_methods
(
false
).
each
do
|
method_name
|
method
=
described_class
.
method
(
method_name
)
ee_result
=
method
.
call
ce_result
=
method
.
super_method
.
call
failure_message
=
"expected
#{
method
}
to have no value conflicts, but it has.
\n
Please make sure you are not overriding values.
\n
Actual values: EE
#{
ee_result
}
, CE
#{
ce_result
}
"
expect
(
ee_result
).
to
include
(
ce_result
),
failure_message
expect
(
ee_result
.
values
).
to
match_array
(
ee_result
.
values
.
uniq
)
end
end
end
ee/spec/models/ee/user_type_enums_spec.rb
0 → 100644
View file @
17f79af7
# frozen_string_literal: true
require
'spec_helper'
describe
UserTypeEnums
do
it
'has no type conflicts between CE and EE'
,
:aggregate_failures
do
described_class
.
public_methods
(
false
).
each
do
|
method_name
|
method
=
described_class
.
method
(
method_name
)
ee_result
=
method
.
call
ce_result
=
method
.
super_method
.
call
failure_message
=
"expected
#{
method
}
to have no value conflicts, but it has.
\n
Please make sure you are not overriding values.
\n
Actual values: EE
#{
ee_result
}
, CE
#{
ce_result
}
"
expect
(
ee_result
).
to
include
(
ce_result
),
failure_message
expect
(
ee_result
.
values
).
to
match_array
(
ee_result
.
values
.
uniq
)
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