⌚ 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.

add_test.rb 839B

123456789101112131415161718192021222324252627282930313233
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. describe Hours::Commands::Node::Add::Command do
  4. describe '.build' do
  5. subject { Hours::Commands::Node::Add::Command }
  6. describe 'without a node_id' do
  7. let(:params) { { lat: 10, lon: 10 } }
  8. it 'raises as error' do
  9. assert_raises(BadRequest, 'todo_id is blank') { subject.build(params) }
  10. end
  11. end
  12. describe 'without a lat' do
  13. let(:params) { { node_id: SecureRandom.uuid, lon: 10 } }
  14. it 'raises as error' do
  15. assert_raises(BadRequest, 'lat is blank') { subject.build(params) }
  16. end
  17. end
  18. describe 'without a lon' do
  19. let(:params) { { node_id: SecureRandom.uuid, lat: 10 } }
  20. it 'raises as error' do
  21. assert_raises(BadRequest, 'lon is blank') { subject.build(params) }
  22. end
  23. end
  24. end
  25. end