summaryrefslogtreecommitdiff
path: root/spec/models/project_pages_metadatum_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/project_pages_metadatum_spec.rb')
-rw-r--r--spec/models/project_pages_metadatum_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/project_pages_metadatum_spec.rb b/spec/models/project_pages_metadatum_spec.rb
new file mode 100644
index 00000000000..31a533e0363
--- /dev/null
+++ b/spec/models/project_pages_metadatum_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe ProjectPagesMetadatum do
+ describe '.only_on_legacy_storage' do
+ it 'returns only deployed records without deployment' do
+ create(:project) # without pages deployed
+
+ legacy_storage_project = create(:project)
+ legacy_storage_project.mark_pages_as_deployed
+
+ project_with_deployment = create(:project)
+ deployment = create(:pages_deployment, project: project_with_deployment)
+ project_with_deployment.mark_pages_as_deployed
+ project_with_deployment.update_pages_deployment!(deployment)
+
+ expect(described_class.only_on_legacy_storage).to eq([legacy_storage_project.pages_metadatum])
+ end
+ end
+end