Commit f8cec9dc authored by Vitali Tatarintev's avatar Vitali Tatarintev Committed by Stan Hu

Use :geo_fdw + let in Geo related specs

parent 0f8139f0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Geo::Fdw::Project, :geo, type: :model do RSpec.describe Geo::Fdw::Project, :geo_fdw, type: :model do
context 'relationships' do context 'relationships' do
it { is_expected.to have_many(:job_artifacts).class_name('Geo::Fdw::Ci::JobArtifact') } it { is_expected.to have_many(:job_artifacts).class_name('Geo::Fdw::Ci::JobArtifact') }
it { is_expected.to have_many(:lfs_objects_projects).class_name('Geo::Fdw::LfsObjectsProject') } it { is_expected.to have_many(:lfs_objects_projects).class_name('Geo::Fdw::LfsObjectsProject') }
...@@ -11,8 +11,8 @@ RSpec.describe Geo::Fdw::Project, :geo, type: :model do ...@@ -11,8 +11,8 @@ RSpec.describe Geo::Fdw::Project, :geo, type: :model do
end end
describe '.search' do describe '.search' do
let_it_be(:test_project, refind: true) { create(:project, description: 'kitten mittens') } let(:test_project) { create(:project, description: 'kitten mittens') }
let_it_be(:project) { described_class.find(test_project.id) } let(:project) { described_class.find(test_project.id) }
it 'returns projects with a matching name' do it 'returns projects with a matching name' do
expect(described_class.search(project.name)).to eq([project]) expect(described_class.search(project.name)).to eq([project])
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
require 'spec_helper' require 'spec_helper'
describe Geo::ProjectRegistry do describe Geo::ProjectRegistry, :geo_fdw do
include ::EE::GeoHelpers include ::EE::GeoHelpers
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let_it_be(:project, refind: true) { create(:project, description: 'kitten mittens') } let(:project) { create(:project, description: 'kitten mittens') }
let_it_be(:registry, refind: true) { create(:geo_project_registry, project_id: project.id) } let(:registry) { create(:geo_project_registry, project_id: project.id) }
subject { registry } subject { registry }
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
require 'spec_helper' require 'spec_helper'
describe API::GeoNodes, :request_store, :geo, :prometheus, api: true do describe API::GeoNodes, :request_store, :geo_fdw, :prometheus, api: true do
include ApiHelpers include ApiHelpers
include ::EE::GeoHelpers include ::EE::GeoHelpers
include_context 'custom session' include_context 'custom session'
let_it_be(:admin, refind: true) { create(:admin) } let!(:admin) { create(:admin) }
let_it_be(:user, refind: true) { create(:user) } let!(:user) { create(:user) }
let_it_be(:primary, refind: true) { create(:geo_node, :primary) } let!(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary, refind: true) { create(:geo_node) } let!(:secondary) { create(:geo_node) }
let_it_be(:secondary_status, refind: true) { create(:geo_node_status, :healthy, geo_node: secondary) } let!(:secondary_status) { create(:geo_node_status, :healthy, geo_node: secondary) }
let(:unexisting_node_id) { GeoNode.maximum(:id).to_i.succ } let(:unexisting_node_id) { GeoNode.maximum(:id).to_i.succ }
let(:group_to_sync) { create(:group) } let(:group_to_sync) { create(:group) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment