diff options
Diffstat (limited to 'spec/support/shared_examples/models/cluster_application_version_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/models/cluster_application_version_shared_examples.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb b/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb index cf7010c48c2..ed2e4fee2de 100644 --- a/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb +++ b/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb @@ -19,4 +19,32 @@ RSpec.shared_examples 'cluster application version specs' do |application_name| it { is_expected.to be_falsey } end end + + describe '#make_installed' do + subject { create(application_name, :installing) } + + it 'sets the correct version of the application' do + subject.update!(version: '0.0.0') + + subject.make_installed! + + subject.reload + + expect(subject.version).to eq(subject.class.const_get(:VERSION, false)) + end + + context 'application is updating' do + subject { create(application_name, :updating) } + + it 'updates the version of the application' do + subject.update!(version: '0.0.0') + + subject.make_installed! + + subject.reload + + expect(subject.version).to eq(subject.class.const_get(:VERSION, false)) + end + end + end end |