Fix bug where ticket check-ins don't work properly. Closes #101

This commit is contained in:
Eric Schultz 2018-10-23 10:43:58 -05:00 committed by Eric Schultz
parent efbe2a0a80
commit e4161531aa
2 changed files with 11 additions and 2 deletions

View file

@ -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

View file

@ -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)