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
a7270b34
Commit
a7270b34
authored
Apr 01, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set version when externally installed
parent
db87dc61
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
app/models/clusters/concerns/application_version.rb
app/models/clusters/concerns/application_version.rb
+6
-0
spec/support/shared_examples/models/cluster_application_version_shared_examples.rb
...les/models/cluster_application_version_shared_examples.rb
+11
-0
No files found.
app/models/clusters/concerns/application_version.rb
View file @
a7270b34
...
...
@@ -5,11 +5,17 @@ module Clusters
module
ApplicationVersion
extend
ActiveSupport
::
Concern
EXTERNAL_VERSION
=
'EXTERNALLY_INSTALLED'
included
do
state_machine
:status
do
before_transition
any
=>
[
:installed
,
:updated
]
do
|
application
|
application
.
version
=
application
.
class
.
const_get
(
:VERSION
,
false
)
end
before_transition
any
=>
[
:externally_installed
]
do
|
application
|
application
.
version
=
EXTERNAL_VERSION
end
end
end
...
...
spec/support/shared_examples/models/cluster_application_version_shared_examples.rb
View file @
a7270b34
...
...
@@ -47,4 +47,15 @@ RSpec.shared_examples 'cluster application version specs' do |application_name|
end
end
end
describe
'#make_externally_installed'
do
subject
{
build
(
application_name
)
}
it
'sets to a special version'
do
subject
.
make_externally_installed!
expect
(
subject
).
to
be_persisted
expect
(
subject
.
version
).
to
eq
(
'EXTERNALLY_INSTALLED'
)
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