Skip to content

Commit

Permalink
added test coverage for methods queued from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Sep 11, 2018
1 parent 887b300 commit e3a7da4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/replication/util/miq_pglogical_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,26 @@
expect(described_class.node_name_to_region("region_5")).to eq(5)
end
end

describe ".save_replication_type" do
it "update replication type for this region" do
expect(MiqRegion).to receive(:replication_type=).with(:remote)
described_class.save_replication_type(:remote)
end
end

describe ".save_remote_region" do
it "sets replication type for this region to 'remote'" do
allow(described_class).to receive(:refresh_excludes)
expect(described_class).to receive(:save_replication_type).with(:remote)
described_class.save_remote_region("")
end

it "updates list of tables to be excluded from replication" do
tables = "---\n- vmdb_databases\n- vmdb_indexes\n- vmdb_metrics\n- vmdb_tables\n"
allow(described_class).to receive(:save_replication_type).with(:remote)
expect(described_class).to receive(:refresh_excludes).with(YAML.safe_load(tables))
described_class.save_remote_region(tables)
end
end
end

0 comments on commit e3a7da4

Please sign in to comment.