From bebfa1baee658d4d897aa55ccfe7241f06c7523c Mon Sep 17 00:00:00 2001 From: lindseytruong Date: Tue, 26 Nov 2024 11:22:49 -0500 Subject: [PATCH] rubocop --- lib/lightspeed_restaurant/operations/create.rb | 6 +++--- .../external_payment_provider_spec.rb | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/lightspeed_restaurant/operations/create.rb b/lib/lightspeed_restaurant/operations/create.rb index 0395e6c..8b12aa1 100644 --- a/lib/lightspeed_restaurant/operations/create.rb +++ b/lib/lightspeed_restaurant/operations/create.rb @@ -14,10 +14,10 @@ def create(attributes, configuration = nil) private def handle_create_response(response, attributes) - case when response == Numeric + if response == Numeric attributes.merge(id: response) - when LightspeedRestaurantClient::ExternalPaymentProvider - attributes.merge(id: response["data"].first["id"]) + elsif LightspeedRestaurantClient::ExternalPaymentProvider + attributes.merge(id: response['data'].first['id']) else response end diff --git a/spec/lightspeed_restaurant/external_payment_provider_spec.rb b/spec/lightspeed_restaurant/external_payment_provider_spec.rb index 0dd434a..7743444 100644 --- a/spec/lightspeed_restaurant/external_payment_provider_spec.rb +++ b/spec/lightspeed_restaurant/external_payment_provider_spec.rb @@ -25,13 +25,13 @@ module LightspeedRestaurantClient it 'includes external payment providers' do result = described_class.find(resource_id) expect(result.data).to eq({ - 'companyID' => 1, - 'creationDate' => '2024-11-17:28:02.467Z', - 'id' => 1, - 'name' => 'House Account (External)', - 'updateDate' => '2024-11-17:28:02.467Z', - 'url' => 'https://dummy-payment-url.com' - }) + 'companyID' => 1, + 'creationDate' => '2024-11-17:28:02.467Z', + 'id' => 1, + 'name' => 'House Account (External)', + 'updateDate' => '2024-11-17:28:02.467Z', + 'url' => 'https://dummy-payment-url.com' + }) end end end