Add event store for Geo::ResetChecksumEvent

parent 8d51a91f
# frozen_string_literal: true
module Geo
class ResetChecksumEventStore < EventStore
self.event_type = :reset_checksum_event
private
def build_event
Geo::ResetChecksumEvent.new(project: project)
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Geo::ResetChecksumEventStore do
include EE::GeoHelpers
set(:project) { create(:project) }
set(:secondary_node) { create(:geo_node) }
subject { described_class.new(project) }
describe '#create' do
it_behaves_like 'a Geo event store', Geo::ResetChecksumEvent
context 'when running on a primary node' do
before do
stub_primary_node
end
it 'tracks the project that checksum must be wiped' do
subject.create
expect(Geo::ResetChecksumEvent.last).to have_attributes(project_id: project.id)
end
end
end
end
# frozen_string_literal: true # frozen_string_literal: true
shared_examples_for 'a Geo event store' do |event_class| shared_examples_for 'a Geo event store' do |event_class|
context 'running on a secondary node' do context 'when running on a secondary node' do
before do before do
stub_secondary_node stub_secondary_node
end end
......
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