diff --git a/lib/update/update_tickets.rb b/lib/update/update_tickets.rb index 0b77b7be..393ba2a9 100644 --- a/lib/update/update_tickets.rb +++ b/lib/update/update_tickets.rb @@ -9,7 +9,7 @@ module UpdateTickets bid_id: {is_integer: true}, #note: nothing to check? - checked_in: {included_in: ['true', 'false']} + checked_in: {included_in: ['true', 'false', true, false]} }) @@ -40,7 +40,7 @@ module UpdateTickets edited = true end - if data[:checked_in] + unless data[:checked_in].nil? entities[:ticket_id].checked_in = data[:checked_in] edited = true end diff --git a/spec/lib/update/update_tickets_spec.rb b/spec/lib/update/update_tickets_spec.rb index 86533030..7c8df4e1 100644 --- a/spec/lib/update/update_tickets_spec.rb +++ b/spec/lib/update/update_tickets_spec.rb @@ -188,6 +188,15 @@ describe UpdateTickets do expect(ticket.attributes).to eq expected end + it 'success editing checked_in as a boolean' do + result = UpdateTickets.update(basic_valid_ticket_input.merge(checked_in:true)) + expected = general_expected.merge(checked_in: true) + + expect(result.attributes).to eq expected + ticket.reload + expect(ticket.attributes).to eq expected + end + it 'success editing token' do result = UpdateTickets.update(basic_valid_ticket_input.merge(token:source_token.token)) expected = general_expected.merge(source_token_id: source_token.id)