diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c1ec3b..1e0728a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## Next Release + +- Adds the following functions: + - `embeddable.create_session` + - `customer_portal.create_account_link` + ## v7.2.0 (2025-11-10) - Adds support for `UspsShipAccount` diff --git a/lib/easypost/client.rb b/lib/easypost/client.rb index 1cc7967..a44c44b 100644 --- a/lib/easypost/client.rb +++ b/lib/easypost/client.rb @@ -43,8 +43,10 @@ def initialize(api_key:, read_timeout: 60, open_timeout: 30, api_base: 'https:// EasyPost::Services::CarrierMetadata, EasyPost::Services::CarrierType, EasyPost::Services::Claim, + EasyPost::Services::CustomerPortal, EasyPost::Services::CustomsInfo, EasyPost::Services::CustomsItem, + EasyPost::Services::Embeddable, EasyPost::Services::EndShipper, EasyPost::Services::Event, EasyPost::Services::Insurance, diff --git a/lib/easypost/services.rb b/lib/easypost/services.rb index d861581..0f0e386 100644 --- a/lib/easypost/services.rb +++ b/lib/easypost/services.rb @@ -15,8 +15,10 @@ module EasyPost::Services require_relative 'services/carrier_metadata' require_relative 'services/carrier_type' require_relative 'services/claim' +require_relative 'services/customer_portal' require_relative 'services/customs_info' require_relative 'services/customs_item' +require_relative 'services/embeddable' require_relative 'services/end_shipper' require_relative 'services/event' require_relative 'services/insurance' diff --git a/lib/easypost/services/customer_portal.rb b/lib/easypost/services/customer_portal.rb new file mode 100644 index 0000000..1f6ea27 --- /dev/null +++ b/lib/easypost/services/customer_portal.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class EasyPost::Services::CustomerPortal < EasyPost::Services::Service + # Create a Portal Session + def create_account_link(params = {}) + response = @client.make_request(:post, 'customer_portal/account_link', params) + + EasyPost::InternalUtilities::Json.convert_json_to_object(response) + end +end diff --git a/lib/easypost/services/embeddable.rb b/lib/easypost/services/embeddable.rb new file mode 100644 index 0000000..ae8334e --- /dev/null +++ b/lib/easypost/services/embeddable.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class EasyPost::Services::Embeddable < EasyPost::Services::Service + # Create an Embeddable Session + def create_session(params = {}) + response = @client.make_request(:post, 'embeddables/session', params) + + EasyPost::InternalUtilities::Json.convert_json_to_object(response) + end +end diff --git a/spec/cassettes/customer_portal/EasyPost_Services_CustomerPortal_customer_portal_creates_an_account_link.yml b/spec/cassettes/customer_portal/EasyPost_Services_CustomerPortal_customer_portal_creates_an_account_link.yml new file mode 100644 index 0000000..2b9fd8b --- /dev/null +++ b/spec/cassettes/customer_portal/EasyPost_Services_CustomerPortal_customer_portal_creates_an_account_link.yml @@ -0,0 +1,144 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.easypost.com/v2/users/children + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: "" + Host: + - api.easypost.com + Content-Type: + - application/json + Authorization: "" + response: + status: + code: 200 + message: OK + headers: + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - strict-origin-when-cross-origin + X-Ep-Request-Uuid: + - 56d897ac691b6ef7e786abfc0281efdb + Cache-Control: + - private, no-cache, no-store + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - application/json; charset=utf-8 + X-Runtime: + - '0.090962' + Transfer-Encoding: + - chunked + X-Node: + - bigweb54nuq + X-Version-Label: + - easypost-202511171535-3e300ad867-master + X-Backend: + - easypost + X-Proxied: + - extlb2nuq cbbd141214 + - intlb4nuq c0061e0a2e + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"children":[{"id":"user_484dd58db70a4f31b4bb862998cf0e04","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2023-05-16T22:01:20Z"},{"id":"user_14e894c0d541459395f4456e7cf4f175","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2023-09-27T22:05:26Z"},{"id":"user_f04df3dad13848339a7975d295d6629f","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2023-11-30T19:23:22Z"},{"id":"user_44d216445b2f4595a123a18084000d94","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-26T18:36:54Z"},{"id":"user_f3b7021a2d924bedb080d7caa00d753e","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-26T18:41:48Z"},{"id":"user_327a26c77be24e24b165450e7c0de3b9","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-26T19:08:21Z"},{"id":"user_acfa6f7268d14e449edd1fe6f4ab64cc","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T17:41:32Z"},{"id":"user_4b066506d76940aeb28943506eb76941","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T17:46:31Z"},{"id":"user_48b7c8e5981647a8aee52aa1cb910280","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T18:07:19Z"},{"id":"user_dc18fb938f184bfd8f345d7fb1469130","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T21:45:16Z"},{"id":"user_06004d67f8294a73b2a21b62d5a2e3d6","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T21:50:35Z"},{"id":"user_b760795a35e24bfc803b51b29cca0d7e","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T21:59:34Z"},{"id":"user_a2e569dd62f14b75b2f8c84aa62ded62","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T22:03:04Z"},{"id":"user_85480046d6514ea3863eb950fbea392e","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T22:04:22Z"},{"id":"user_89583592d7914082b3b61fdf9230db38","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-08-01T17:06:15Z"}],"has_more":false}' + recorded_at: Mon, 17 Nov 2025 18:52:39 GMT +- request: + method: post + uri: https://api.easypost.com/v2/customer_portal/account_link + body: + encoding: UTF-8 + string: '{"session_type":"account_onboarding","user_id":"user_484dd58db70a4f31b4bb862998cf0e04","refresh_url":"https://example.com/refresh","return_url":"https://example.com/return"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: "" + Host: + - api.easypost.com + Content-Type: + - application/json + Authorization: "" + response: + status: + code: 201 + message: Created + headers: + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - strict-origin-when-cross-origin + X-Ep-Request-Uuid: + - 56d897a8691b6ef7e786abff0281f057 + Cache-Control: + - private, no-cache, no-store + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - application/json; charset=utf-8 + X-Runtime: + - '0.151938' + Transfer-Encoding: + - chunked + X-Node: + - bigweb41nuq + X-Version-Label: + - easypost-202511171535-3e300ad867-master + X-Backend: + - easypost + X-Proxied: + - extlb2nuq cbbd141214 + - intlb6nuq c0061e0a2e + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"link":"https://app.easypost.com/customer-portal/onboarding?session_id=yIuV3XCFXvpyTCUJ","object":"CustomerPortalAccountLink","expires_at":"2025-11-17T18:57:39Z","created_at":"2025-11-17T18:52:39Z"}' + recorded_at: Mon, 17 Nov 2025 18:52:39 GMT +recorded_with: VCR 6.3.1 diff --git a/spec/cassettes/embeddable/EasyPost_Services_Embeddable_embeddables_creates_a_session.yml b/spec/cassettes/embeddable/EasyPost_Services_Embeddable_embeddables_creates_a_session.yml new file mode 100644 index 0000000..83ddebb --- /dev/null +++ b/spec/cassettes/embeddable/EasyPost_Services_Embeddable_embeddables_creates_a_session.yml @@ -0,0 +1,148 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.easypost.com/v2/users/children + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: "" + Host: + - api.easypost.com + Content-Type: + - application/json + Authorization: "" + response: + status: + code: 200 + message: OK + headers: + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - strict-origin-when-cross-origin + X-Ep-Request-Uuid: + - 56d897af691b6f31e786ac1f02824807 + Cache-Control: + - private, no-cache, no-store + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - application/json; charset=utf-8 + X-Runtime: + - '0.316007' + Transfer-Encoding: + - chunked + X-Node: + - bigweb43nuq + X-Version-Label: + - easypost-202511171535-3e300ad867-master + X-Backend: + - easypost + X-Canary: + - direct + X-Proxied: + - extlb2nuq cbbd141214 + - intlb3nuq c0061e0a2e + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"children":[{"id":"user_484dd58db70a4f31b4bb862998cf0e04","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2023-05-16T22:01:20Z"},{"id":"user_14e894c0d541459395f4456e7cf4f175","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2023-09-27T22:05:26Z"},{"id":"user_f04df3dad13848339a7975d295d6629f","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2023-11-30T19:23:22Z"},{"id":"user_44d216445b2f4595a123a18084000d94","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-26T18:36:54Z"},{"id":"user_f3b7021a2d924bedb080d7caa00d753e","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-26T18:41:48Z"},{"id":"user_327a26c77be24e24b165450e7c0de3b9","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-26T19:08:21Z"},{"id":"user_acfa6f7268d14e449edd1fe6f4ab64cc","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T17:41:32Z"},{"id":"user_4b066506d76940aeb28943506eb76941","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T17:46:31Z"},{"id":"user_48b7c8e5981647a8aee52aa1cb910280","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T18:07:19Z"},{"id":"user_dc18fb938f184bfd8f345d7fb1469130","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T21:45:16Z"},{"id":"user_06004d67f8294a73b2a21b62d5a2e3d6","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T21:50:35Z"},{"id":"user_b760795a35e24bfc803b51b29cca0d7e","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T21:59:34Z"},{"id":"user_a2e569dd62f14b75b2f8c84aa62ded62","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T22:03:04Z"},{"id":"user_85480046d6514ea3863eb950fbea392e","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-07-29T22:04:22Z"},{"id":"user_89583592d7914082b3b61fdf9230db38","object":"User","parent_id":"user_0f6b83e3530b401cb1e8aeaa6a250d4d","name":"Test + User","phone_number":"","verified":true,"created_at":"2024-08-01T17:06:15Z"}],"has_more":false}' + recorded_at: Mon, 17 Nov 2025 18:53:37 GMT +- request: + method: post + uri: https://api.easypost.com/v2/embeddables/session + body: + encoding: UTF-8 + string: '{"origin_host":"https://example.com","user_id":"user_484dd58db70a4f31b4bb862998cf0e04"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: "" + Host: + - api.easypost.com + Content-Type: + - application/json + Authorization: "" + response: + status: + code: 201 + message: Created + headers: + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + Referrer-Policy: + - strict-origin-when-cross-origin + X-Ep-Request-Uuid: + - 56d897aa691b6f31e786ac22028248ba + Cache-Control: + - private, no-cache, no-store + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - application/json; charset=utf-8 + X-Runtime: + - '0.147123' + Transfer-Encoding: + - chunked + X-Node: + - bigweb43nuq + X-Version-Label: + - easypost-202511171535-3e300ad867-master + X-Backend: + - easypost + X-Canary: + - direct + X-Proxied: + - extlb2nuq cbbd141214 + - intlb3nuq c0061e0a2e + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"object":"EmbeddablesSession","session_id":"y1LydZP-rE8qZidB","expires_at":"2025-11-17T19:08:37Z","created_at":"2025-11-17T18:53:37Z"}' + recorded_at: Mon, 17 Nov 2025 18:53:37 GMT +recorded_with: VCR 6.3.1 diff --git a/spec/cassettes/referral_customer/EasyPost_Services_ReferralCustomer_create_creates_a_referral_customer.yml b/spec/cassettes/referral_customer/EasyPost_Services_ReferralCustomer_create_creates_a_referral_customer.yml index ebad782..fc164d4 100644 --- a/spec/cassettes/referral_customer/EasyPost_Services_ReferralCustomer_create_creates_a_referral_customer.yml +++ b/spec/cassettes/referral_customer/EasyPost_Services_ReferralCustomer_create_creates_a_referral_customer.yml @@ -5,7 +5,7 @@ http_interactions: uri: https://api.easypost.com/v2/referral_customers body: encoding: UTF-8 - string: '{"user":{"name":"test user","email":"email@example.com","phone":"8888888888"}}' + string: '{"user":{"name":"Test Referral","email":"test@example.com","phone":"5555555555"}}' headers: Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 @@ -35,7 +35,7 @@ http_interactions: Referrer-Policy: - strict-origin-when-cross-origin X-Ep-Request-Uuid: - - d044fa7466a7dad7e799e0fe005a01e1 + - 56d897a8691b6821e786a75f0275ed4a Cache-Control: - private, no-cache, no-store Pragma: @@ -45,25 +45,25 @@ http_interactions: Content-Type: - application/json; charset=utf-8 X-Runtime: - - '0.757322' + - '0.668750' Transfer-Encoding: - chunked X-Node: - bigweb32nuq X-Version-Label: - - easypost-202407291746-57ea285141-master + - easypost-202511171535-3e300ad867-master X-Backend: - easypost X-Canary: - direct X-Proxied: - - extlb1nuq fa152d4755 - - intlb4nuq c0f5e722d1 + - extlb2nuq cbbd141214 + - intlb5nuq c0061e0a2e Strict-Transport-Security: - max-age=31536000; includeSubDomains; preload body: encoding: UTF-8 - string: '{"id":"user_675bc1a2bcd94af68efe73b4edcfb614","object":"User","parent_id":null,"name":"test - user","phone_number":"","verified":true,"created_at":"2024-07-29T18:09:28Z","default_carbon_offset":false,"has_elevate_access":false,"balance":"0.00000","price_per_shipment":"0.00000","recharge_amount":null,"secondary_recharge_amount":null,"recharge_threshold":null,"has_billing_method":null,"cc_fee_rate":"0.0375","default_insurance_amount":"50.00","insurance_fee_rate":"0.01","insurance_fee_minimum":"0.50","email":"","children":[],"api_keys":[{"object":"ApiKey","key":"","mode":"test","created_at":"2024-07-29T18:09:28Z","active":true,"id":"ak_125b9c58b1c74d979d1784cd12af45e6"},{"object":"ApiKey","key":"","mode":"production","created_at":"2024-07-29T18:09:28Z","active":true,"id":"ak_91e5dd6f05244fe790868c3bf366a6a8"}]}' - recorded_at: Mon, 29 Jul 2024 18:09:28 GMT -recorded_with: VCR 6.1.0 + string: '{"id":"user_05d2187f30544a92b5e72043881495b5","object":"User","parent_id":null,"name":"Test + Referral","phone_number":"","verified":true,"created_at":"2025-11-17T18:23:29Z","default_carbon_offset":false,"has_elevate_access":false,"balance":"0.00000","price_per_shipment":"0.00000","recharge_amount":null,"secondary_recharge_amount":null,"recharge_threshold":null,"has_billing_method":null,"cc_fee_rate":"0.0375","default_insurance_amount":"50.00","insurance_fee_rate":"0.01","insurance_fee_minimum":"0.50","email":"","children":[],"api_keys":[{"object":"ApiKey","key":"","mode":"test","created_at":"2025-11-17T18:23:30Z","active":true,"id":"ak_30dccb3869a643d2846e073a70619446"},{"object":"ApiKey","key":"","mode":"production","created_at":"2025-11-17T18:23:30Z","active":true,"id":"ak_603859a9e4eb451fb635db57b8bd2e50"}]}' + recorded_at: Mon, 17 Nov 2025 18:23:30 GMT +recorded_with: VCR 6.3.1 diff --git a/spec/customer_portal_spec.rb b/spec/customer_portal_spec.rb new file mode 100644 index 0000000..70b80c3 --- /dev/null +++ b/spec/customer_portal_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe EasyPost::Services::CustomerPortal do + let(:client) { EasyPost::Client.new(api_key: ENV['EASYPOST_PROD_API_KEY']) } + + describe 'customer portal' do + it 'creates an account link' do + user = client.user.all_children.children.first + + account_link = client.customer_portal.create_account_link( + { + session_type: 'account_onboarding', + user_id: user.id, + refresh_url: 'https://example.com/refresh', + return_url: 'https://example.com/return', + }, + ) + + expect(account_link.object).to eq('CustomerPortalAccountLink') + end + end +end diff --git a/spec/embeddable_spec.rb b/spec/embeddable_spec.rb new file mode 100644 index 0000000..ff0f3b5 --- /dev/null +++ b/spec/embeddable_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe EasyPost::Services::Embeddable do + let(:client) { EasyPost::Client.new(api_key: ENV['EASYPOST_PROD_API_KEY']) } + + describe 'embeddables' do + it 'creates a session' do + user = client.user.all_children.children.first + + session = client.embeddable.create_session( + { + origin_host: 'https://example.com', + user_id: user.id, + }, + ) + + expect(session.object).to eq('EmbeddablesSession') + end + end +end diff --git a/spec/referral_customer_spec.rb b/spec/referral_customer_spec.rb index 81ff173..6fb4497 100644 --- a/spec/referral_customer_spec.rb +++ b/spec/referral_customer_spec.rb @@ -11,14 +11,14 @@ it 'creates a referral customer' do # This test requires a partner user's production API key via PARTNER_USER_PROD_API_KEY. created_referral_customer = client.referral_customer.create( - name: 'test user', - email: 'email@example.com', - phone: '8888888888', + name: Fixture.referral_user['name'], + email: Fixture.referral_user['email'], + phone: Fixture.referral_user['phone'], ) expect(created_referral_customer).to be_an_instance_of(EasyPost::Models::User) expect(created_referral_customer.id).to match('user_') - expect(created_referral_customer.name).to eq('test user') + expect(created_referral_customer.name).to eq('Test Referral') end end diff --git a/spec/support/fixture.rb b/spec/support/fixture.rb index 8f04aab..3f5f938 100644 --- a/spec/support/fixture.rb +++ b/spec/support/fixture.rb @@ -180,4 +180,8 @@ def self.luma_ruleset_name def self.luma_planned_ship_date '2025-06-12' end + + def self.referral_user + read_fixture_data['users']['referral'] + end end