diff options
Diffstat (limited to 'spec/events/pages')
-rw-r--r-- | spec/events/pages/page_deleted_event_spec.rb | 35 | ||||
-rw-r--r-- | spec/events/pages/page_deployed_event_spec.rb | 34 |
2 files changed, 0 insertions, 69 deletions
diff --git a/spec/events/pages/page_deleted_event_spec.rb b/spec/events/pages/page_deleted_event_spec.rb deleted file mode 100644 index 8fcd807eeb4..00000000000 --- a/spec/events/pages/page_deleted_event_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Pages::PageDeletedEvent do - where(:data, :valid) do - [ - [{ project_id: 1, namespace_id: 2 }, true], - [{ project_id: 1, namespace_id: 2, root_namespace_id: 3 }, true], - [{ project_id: 1 }, false], - [{ namespace_id: 1 }, false], - [{ project_id: 'foo', namespace_id: 2 }, false], - [{ project_id: 1, namespace_id: 'foo' }, false], - [{ project_id: [], namespace_id: 2 }, false], - [{ project_id: 1, namespace_id: [] }, false], - [{ project_id: {}, namespace_id: 2 }, false], - [{ project_id: 1, namespace_id: {} }, false], - ['foo', false], - [123, false], - [[], false] - ] - end - - with_them do - it 'validates data' do - constructor = -> { described_class.new(data: data) } - - if valid - expect { constructor.call }.not_to raise_error - else - expect { constructor.call }.to raise_error(Gitlab::EventStore::InvalidEvent) - end - end - end -end diff --git a/spec/events/pages/page_deployed_event_spec.rb b/spec/events/pages/page_deployed_event_spec.rb deleted file mode 100644 index 0c33a95b281..00000000000 --- a/spec/events/pages/page_deployed_event_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Pages::PageDeployedEvent do - where(:data, :valid) do - [ - [{ project_id: 1, namespace_id: 2, root_namespace_id: 3 }, true], - [{ project_id: 1 }, false], - [{ namespace_id: 1 }, false], - [{ project_id: 'foo', namespace_id: 2 }, false], - [{ project_id: 1, namespace_id: 'foo' }, false], - [{ project_id: [], namespace_id: 2 }, false], - [{ project_id: 1, namespace_id: [] }, false], - [{ project_id: {}, namespace_id: 2 }, false], - [{ project_id: 1, namespace_id: {} }, false], - ['foo', false], - [123, false], - [[], false] - ] - end - - with_them do - it 'validates data' do - constructor = -> { described_class.new(data: data) } - - if valid - expect { constructor.call }.not_to raise_error - else - expect { constructor.call }.to raise_error(Gitlab::EventStore::InvalidEvent) - end - end - end -end |