@@ -30,23 +30,25 @@ def patch(*, **)
3030
3131 describe '#create_account_number' do
3232 before do
33- allow ( client ) . to receive ( :build_account_number )
33+ allow ( Fintoc :: Transfers :: AccountNumber ) . to receive ( :new )
3434 end
3535
3636 it 'calls build_account_number with the response' do
3737 client . create_account_number ( account_id : 'acc_123' )
38- expect ( client ) . to have_received ( :build_account_number ) . with ( { mock : 'response' } )
38+ expect ( Fintoc ::Transfers ::AccountNumber )
39+ . to have_received ( :new ) . with ( mock : 'response' , client :)
3940 end
4041 end
4142
4243 describe '#get_account_number' do
4344 before do
44- allow ( client ) . to receive ( :build_account_number )
45+ allow ( Fintoc :: Transfers :: AccountNumber ) . to receive ( :new )
4546 end
4647
4748 it 'calls build_account_number with the response' do
4849 client . get_account_number ( 'acno_123' )
49- expect ( client ) . to have_received ( :build_account_number ) . with ( { mock : 'response' } )
50+ expect ( Fintoc ::Transfers ::AccountNumber )
51+ . to have_received ( :new ) . with ( mock : 'response' , client :)
5052 end
5153 end
5254
@@ -55,24 +57,27 @@ def patch(*, **)
5557 allow ( client )
5658 . to receive ( :_list_account_numbers )
5759 . and_return ( [ { mock : 'response1' } , { mock : 'response2' } ] )
58- allow ( client ) . to receive ( :build_account_number )
60+ allow ( Fintoc :: Transfers :: AccountNumber ) . to receive ( :new )
5961 end
6062
6163 it 'calls build_account_number for each response' do
6264 client . list_account_numbers
63- expect ( client ) . to have_received ( :build_account_number ) . with ( { mock : 'response1' } )
64- expect ( client ) . to have_received ( :build_account_number ) . with ( { mock : 'response2' } )
65+ expect ( Fintoc ::Transfers ::AccountNumber )
66+ . to have_received ( :new ) . with ( mock : 'response1' , client :)
67+ expect ( Fintoc ::Transfers ::AccountNumber )
68+ . to have_received ( :new ) . with ( mock : 'response2' , client :)
6569 end
6670 end
6771
6872 describe '#update_account_number' do
6973 before do
70- allow ( client ) . to receive ( :build_account_number )
74+ allow ( Fintoc :: Transfers :: AccountNumber ) . to receive ( :new )
7175 end
7276
7377 it 'calls build_account_number with the response' do
7478 client . update_account_number ( 'acno_123' , description : 'Updated' )
75- expect ( client ) . to have_received ( :build_account_number ) . with ( { mock : 'response' } )
79+ expect ( Fintoc ::Transfers ::AccountNumber )
80+ . to have_received ( :new ) . with ( mock : 'response' , client :)
7681 end
7782 end
7883end
0 commit comments