⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

query_test.rb 801B

12345678910111213141516171819202122232425262728293031323334353637
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. describe Hours::Projections::Nodes::Query do
  4. subject do
  5. Hours::Projections::Nodes::Query.handle
  6. end
  7. let(:tracker) { Minitest::Mock.new }
  8. let(:projector) do
  9. Hours::Projections::Nodes::Projector.new(tracker: tracker)
  10. end
  11. let(:event) do
  12. NodeAdded.new(
  13. aggregate_id: SecureRandom.uuid,
  14. body: {
  15. lat: 20.01,
  16. lon: 20.02,
  17. author_email: 'ronweasly@example.com',
  18. contact_details: 'The Nest'
  19. }
  20. )
  21. end
  22. before do
  23. # Ensure that we have processed events, which stores nodes in the db
  24. projector.process(event)
  25. end
  26. it 'fetches a list of Nodes through Sequel model' do
  27. assert_kind_of Array, subject
  28. assert_kind_of Hours::Models::Node, subject.first
  29. end
  30. end