diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/models/terraform/state_version_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/models/terraform/state_version_spec.rb')
-rw-r--r-- | spec/models/terraform/state_version_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/terraform/state_version_spec.rb b/spec/models/terraform/state_version_spec.rb index 97ac77d5e7b..ac2e8d167b3 100644 --- a/spec/models/terraform/state_version_spec.rb +++ b/spec/models/terraform/state_version_spec.rb @@ -24,6 +24,24 @@ RSpec.describe Terraform::StateVersion do it { expect(subject.map(&:version)).to eq(versions.sort.reverse) } end + + describe '.with_files_stored_locally' do + subject { described_class.with_files_stored_locally } + + it 'includes states with local storage' do + create_list(:terraform_state_version, 5) + + expect(subject).to have_attributes(count: 5) + end + + it 'excludes states without local storage' do + stub_terraform_state_object_storage + + create_list(:terraform_state_version, 5) + + expect(subject).to have_attributes(count: 0) + end + end end context 'file storage' do |