catarse/catarse.js

View on GitHub
legacy/spec/lib/mocks/subscription.mock.js

Summary

Maintainability
A
0 mins
Test Coverage
beforeAll(function() {
    SubscriptionMockery = function() {
        var attSS = attSS || {};
        var data = {"id":"d594600a-87ae-4108-b871-8cde81c60301","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":500,"status":"active","paid_at":null,"next_charge_at":"2018-06-09T18:12:27.523232","checkout_data":{"amount": "500", "customer": {"name": "bla", "email": "blah@gmail.com", "phone": {"ddd": "12", "ddi": "12", "number": "123456789"}, "address": {"city": "Blah", "state": "CC", "street": "Rua a", "country": "ASDas", "zipcode": "12345-001", "neighborhood": "daoasd ajsd", "complementary": "asasd", "street_number": "123"}, "document_number": "12345678912"}, "anonymous": false, "payment_method": "boleto", "is_international": false, "credit_card_owner_document": null},"created_at":"2018-05-09T18:12:27.523232","user_id":"bdb1a3d1-7d02-4767-baad-18abdf3be236","reward_id":"87e91728-04ce-41cb-b0e7-d6c3515a7f1e","amount":500,"project_external_id":"8","reward_external_id":"17","user_external_id":"2","payment_method":"boleto","last_payment_id":"9ce52e6b-4ab1-4510-95a1-4a5cee81e585","last_paid_payment_id":"9ce52e6b-4ab1-4510-95a1-4a5cee81e585","last_paid_payment_created_at":"2018-05-09T18:12:27.523232","user_email":"asdasd@gmail.com", "current_paid_subscription":{"amount": 500, "customer": {"name": "dasa sdasd", "email": "asdasd@gmail.com", "phone": {"ddd": "12", "ddi": "23", "number": "12345678912"}, "address": {"city": "asdasdasd", "state": "CC", "street": "asadasdasd", "country": "asdasdasd", "zipcode": "12345-123", "neighborhood": "ASda sdasd", "complementary": "asdasd", "street_number": "123"}, "document_number": "12345678912"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec1 QA4", "metadata": null, "row_order": 0, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 500.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"87e91728-04ce-41cb-b0e7-d6c3515a7f1e","updated_at":"2018-05-09T18:12:27.523232"};
        data = _.extend(data, attSS);
        var data2 = {"id":"d594600a-87ae-4108-b871-8cde81c60301","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":500,"status":"canceled","paid_at":null,"next_charge_at":"2018-06-09T18:12:27.523232","checkout_data":{"amount": "500", "customer": {"name": "bla", "email": "blah@gmail.com", "phone": {"ddd": "12", "ddi": "12", "number": "123456789"}, "address": {"city": "Blah", "state": "CC", "street": "Rua a", "country": "ASDas", "zipcode": "12345-001", "neighborhood": "daoasd ajsd", "complementary": "asasd", "street_number": "123"}, "document_number": "12345678912"}, "anonymous": false, "payment_method": "boleto", "is_international": false, "credit_card_owner_document": null},"created_at":"2018-05-09T18:12:27.523232","user_id":"bdb1a3d1-7d02-4767-baad-18abdf3be236","reward_id":"87e91728-04ce-41cb-b0e7-d6c3515a7f1e","amount":500,"project_external_id":"8","reward_external_id":"17","user_external_id":"2","payment_method":"boleto","last_payment_id":"9ce52e6b-4ab1-4510-95a1-4a5cee81e585","last_paid_payment_id":"9ce52e6b-4ab1-4510-95a1-4a5cee81e585","last_paid_payment_created_at":"2018-05-09T18:12:27.523232","user_email":"asdasd@gmail.com", "current_paid_subscription":{"amount": 500, "customer": {"name": "dasa sdasd", "email": "asdasd@gmail.com", "phone": {"ddd": "12", "ddi": "23", "number": "12345678912"}, "address": {"city": "asdasdasd", "state": "CC", "street": "asadasdasd", "country": "asdasdasd", "zipcode": "12345-123", "neighborhood": "ASda sdasd", "complementary": "asdasd", "street_number": "123"}, "document_number": "12345678912"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec1 QA4", "metadata": null, "row_order": 0, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 500.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"87e91728-04ce-41cb-b0e7-d6c3515a7f1e","updated_at":"2018-05-09T18:12:27.523232"};
        var allData = [ {"id":"f197c5bf-2fb8-4b53-a43b-388a93bad6d1","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1000,"status":"active","paid_at":"2018-07-18T13:55:57.02709","next_charge_at":"2018-08-18T00:30:56.955952","checkout_data":null,"created_at":"2018-07-18T00:30:56.955952","user_id":"4b793265-509a-40f4-a690-397def190e63","reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","amount":1000,"project_external_id":"8","reward_external_id":"18","user_external_id":"14","payment_method":"boleto","last_payment_id":"be6325b9-48e5-4e29-9a1f-2bf40f8858f0","last_paid_payment_id":"be6325b9-48e5-4e29-9a1f-2bf40f8858f0","last_paid_payment_created_at":"2018-07-18T00:30:56.955952","user_email":"test12@gmail.com","search_index":"'03776694076':4C '2fb8':7 '388a93bad6d1':10 '397def190e63':16 '40f4':14 '46b4':20 '4b53':8 '4b793265':12 '4b793265-509a-40f4-a690-397def190e63':11 '509a':13 '5d69':19 '8f898112':18 '8f898112-5d69-46b4-aee0-e901287c3575':17 'a43b':9 'a690':15 'aee0':21 'auhsuhasd':3B 'e901287c3575':22 'f197c5bf':6 'f197c5bf-2fb8-4b53-a43b-388a93bad6d1':5 'qa4':1A 'test12@gmail.com':2B","current_paid_subscription":{"amount": 1000, "customer": {"name": "auhsuhasdi", "email": "test12@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "03776694076"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec2 QA4", "metadata": null, "row_order": 4194304, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1000.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","last_payment_data":{"id" : "be6325b9-48e5-4e29-9a1f-2bf40f8858f0", "status" : "paid", "created_at" : "2018-07-18T00:30:56.955952", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "be6325b9-48e5-4e29-9a1f-2bf40f8858f0", "status" : "paid", "created_at" : "2018-07-18T00:30:56.955952", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-18T00:30:56.955952"}, 
                        {"id":"efb020a2-d2d1-4906-bcc5-5f49489da37f","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1500,"status":"active","paid_at":"2018-07-18T13:55:38.33077","next_charge_at":"2018-08-18T00:28:54.964264","checkout_data":null,"created_at":"2018-07-18T00:28:54.964264","user_id":"8e73441f-35cf-4358-8bff-48983e2aa7e0","reward_id":"f03d955a-2c0e-4698-8c81-8a321edec6e0","amount":1500,"project_external_id":"8","reward_external_id":"19","user_external_id":"13","payment_method":"boleto","last_payment_id":"1dbd77ea-a131-49f0-a70e-ace103508e48","last_paid_payment_id":"1dbd77ea-a131-49f0-a70e-ace103508e48","last_paid_payment_created_at":"2018-07-18T00:28:54.964264","user_email":"test11@gmail.com","search_index":"'-8':17 '03776694076':4C '35cf':15 '4358':16 '46b4':24 '48983e2aa7e0':20 '4906':8 '5d69':23 '5f49489da37f':11 '8e73441':12 '8f898112':22 '8f898112-5d69-46b4-aee0-e901287c3575':21 'aee0':25 'bcc5':10 'bcc5-5f49489da37f':9 'bff':19 'bff-48983e2aa7e0':18 'd2d1':7 'e901287c3575':26 'efb020a2':6 'efb020a2-d2d1':5 'f':14 'f-35cf':13 'qa4':1A 'test11@gmail.com':2B 'uhiuh':3B","current_paid_subscription":{"amount": 1500, "customer": {"name": "uhiuh", "email": "test11@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "03776694076"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec3 QA4", "metadata": null, "row_order": 6291456, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1500.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"f03d955a-2c0e-4698-8c81-8a321edec6e0","last_payment_data":{"id" : "1dbd77ea-a131-49f0-a70e-ace103508e48", "status" : "paid", "created_at" : "2018-07-18T00:28:54.964264", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "1dbd77ea-a131-49f0-a70e-ace103508e48", "status" : "paid", "created_at" : "2018-07-18T00:28:54.964264", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-18T00:28:54.964264"}, 
                        {"id":"72235dc4-9dcd-45c8-9b13-49251bc60960","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1000,"status":"active","paid_at":"2018-07-18T13:56:40.467726","next_charge_at":"2018-08-18T00:27:10.533323","checkout_data":null,"created_at":"2018-07-18T00:27:10.533323","user_id":"2911d673-088f-40d6-b2ba-6c7b1f0f4d44","reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","amount":1000,"project_external_id":"8","reward_external_id":"18","user_external_id":"12","payment_method":"boleto","last_payment_id":"51513b1f-d67c-473d-acdc-2612416ffafc","last_paid_payment_id":"51513b1f-d67c-473d-acdc-2612416ffafc","last_paid_payment_created_at":"2018-07-18T00:27:10.533323","user_email":"test10@gmail.com","search_index":"'03776694076':4C '088f':13 '2911d673':12 '2911d673-088f-40d6-b2ba-6c7b1f0f4d44':11 '40d6':14 '45c8':8 '46b4':20 '49251bc60960':10 '5d69':19 '6c7b1f0f4d44':16 '72235dc4':6 '72235dc4-9dcd-45c8-9b13-49251bc60960':5 '8f898112':18 '8f898112-5d69-46b4-aee0-e901287c3575':17 '9b13':9 '9dcd':7 'aee0':21 'b2ba':15 'e901287c3575':22 'ijsdof':3B 'qa4':1A 'test10@gmail.com':2B","current_paid_subscription":{"amount": 1000, "customer": {"name": "ijsdofi", "email": "test10@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "03776694076"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec2 QA4", "metadata": null, "row_order": 4194304, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1000.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","last_payment_data":{"id" : "51513b1f-d67c-473d-acdc-2612416ffafc", "status" : "paid", "created_at" : "2018-07-18T00:27:10.533323", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "51513b1f-d67c-473d-acdc-2612416ffafc", "status" : "paid", "created_at" : "2018-07-18T00:27:10.533323", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-18T00:27:10.533323"}, 
                        {"id":"fbdcb9b0-f4dd-4faa-bd3f-f2d2af5603cd","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1000,"status":"active","paid_at":"2018-07-18T13:56:59.095173","next_charge_at":"2018-08-17T22:34:45.099212","checkout_data":null,"created_at":"2018-07-17T22:34:45.099212","user_id":"73cde366-0320-42c4-ac7e-bbc47738959f","reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","amount":1000,"project_external_id":"8","reward_external_id":"18","user_external_id":"11","payment_method":"boleto","last_payment_id":"b5e542c8-db73-4320-b778-9566b7812c26","last_paid_payment_id":"b5e542c8-db73-4320-b778-9566b7812c26","last_paid_payment_created_at":"2018-07-17T22:34:45.099212","user_email":"test9@gmail.com","search_index":"'-0320':12 '-42':13 '03776694076':4C '46b4':21 '4faa':8 '5d69':20 '73cde366':11 '8f898112':19 '8f898112-5d69-46b4-aee0-e901287c3575':18 'ac7e':16 'aee0':22 'asd':3B 'bbc47738959f':17 'bd3f':9 'c4':15 'c4-ac7e-bbc47738959f':14 'e901287c3575':23 'f2d2af5603cd':10 'f4dd':7 'fbdcb9b0':6 'fbdcb9b0-f4dd-4faa-bd3f-f2d2af5603cd':5 'qa4':1A 'test9@gmail.com':2B","current_paid_subscription":{"amount": 1000, "customer": {"name": "asd", "email": "test9@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "1231"}, "document_number": "03776694076"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec2 QA4", "metadata": null, "row_order": 4194304, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1000.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","last_payment_data":{"id" : "b5e542c8-db73-4320-b778-9566b7812c26", "status" : "paid", "created_at" : "2018-07-17T22:34:45.099212", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "b5e542c8-db73-4320-b778-9566b7812c26", "status" : "paid", "created_at" : "2018-07-17T22:34:45.099212", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-17T22:34:45.099212"}, 
                        {"id":"a28f7ee6-17fc-45d5-88bc-4312c28e0b3a","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1000,"status":"active","paid_at":"2018-07-18T13:57:15.816228","next_charge_at":"2018-08-17T22:32:41.94546","checkout_data":null,"created_at":"2018-07-17T22:32:41.94546","user_id":"31f2e801-7ec1-4bcb-a7f4-9883f23544f8","reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","amount":1000,"project_external_id":"8","reward_external_id":"18","user_external_id":"10","payment_method":"boleto","last_payment_id":"b28e9fc2-e96f-463c-85fa-056c47fbfddc","last_paid_payment_id":"b28e9fc2-e96f-463c-85fa-056c47fbfddc","last_paid_payment_created_at":"2018-07-17T22:32:41.94546","user_email":"test8@gmail.com","search_index":"'03776694076':4C '17fc':7 '31f2e801':12 '31f2e801-7ec1-4bcb-a7f4-9883f23544f8':11 '4312c28e0b3a':10 '45d5':8 '46b4':20 '4bcb':14 '5d69':19 '7ec1':13 '88bc':9 '8f898112':18 '8f898112-5d69-46b4-aee0-e901287c3575':17 '9883f23544f8':16 'a28f7ee6':6 'a28f7ee6-17fc-45d5-88bc-4312c28e0b3a':5 'a7f4':15 'adawd':3B 'aee0':21 'e901287c3575':22 'qa4':1A 'test8@gmail.com':2B","current_paid_subscription":{"amount": 1000, "customer": {"name": "adawd", "email": "test8@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "13", "street_number": "123"}, "document_number": "03776694076"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec2 QA4", "metadata": null, "row_order": 4194304, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1000.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","last_payment_data":{"id" : "b28e9fc2-e96f-463c-85fa-056c47fbfddc", "status" : "paid", "created_at" : "2018-07-17T22:32:41.94546", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "b28e9fc2-e96f-463c-85fa-056c47fbfddc", "status" : "paid", "created_at" : "2018-07-17T22:32:41.94546", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-17T22:32:41.94546"}, 
                        {"id":"6ae83cbf-3494-40b0-a0ea-0863a58ad52a","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1500,"status":"active","paid_at":"2018-07-18T13:57:28.731861","next_charge_at":"2018-08-17T21:27:16.225432","checkout_data":null,"created_at":"2018-07-17T21:27:16.225432","user_id":"80d9dd24-f9ec-4399-a935-635f063e1c44","reward_id":"f03d955a-2c0e-4698-8c81-8a321edec6e0","amount":1500,"project_external_id":"8","reward_external_id":"19","user_external_id":"9","payment_method":"boleto","last_payment_id":"14087e57-43c8-4983-85df-e6fd391da2a4","last_paid_payment_id":"14087e57-43c8-4983-85df-e6fd391da2a4","last_paid_payment_created_at":"2018-07-17T21:27:16.225432","user_email":"test7@gmail.com","search_index":"'-3494':6 '-40':7 '0863a58ad52a':11 '42057772055':4C '4399':15 '46b4':22 '5d69':21 '635f063e1c44':18 '6ae83cbf':5 '80d9dd24':13 '80d9dd24-f9ec':12 '8f898112':20 '8f898112-5d69-46b4-aee0-e901287c3575':19 'a0ea':10 'a935':17 'a935-635f063e1c44':16 'aee0':23 'asiduhaisd':3B 'b0':9 'b0-a0ea-0863a58ad52a':8 'e901287c3575':24 'f9ec':14 'qa4':1A 'test7@gmail.com':2B","current_paid_subscription":{"amount": 1500, "customer": {"name": "asiduhaisd", "email": "test7@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "42057772055"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec3 QA4", "metadata": null, "row_order": 6291456, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1500.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"f03d955a-2c0e-4698-8c81-8a321edec6e0","last_payment_data":{"id" : "14087e57-43c8-4983-85df-e6fd391da2a4", "status" : "paid", "created_at" : "2018-07-17T21:27:16.225432", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "14087e57-43c8-4983-85df-e6fd391da2a4", "status" : "paid", "created_at" : "2018-07-17T21:27:16.225432", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-17T21:27:16.225432"}, 
                        {"id":"b891d74a-ee95-4150-976e-01127e8b4f47","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1000,"status":"active","paid_at":"2018-07-18T13:57:40.953106","next_charge_at":"2018-08-17T19:13:57.796328","checkout_data":null,"created_at":"2018-07-17T19:13:57.796328","user_id":"bfa23714-e1dd-40bd-9b03-50220ff507ea","reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","amount":1000,"project_external_id":"8","reward_external_id":"18","user_external_id":"8","payment_method":"boleto","last_payment_id":"6681b7c7-e68d-46f6-b859-29dcd06c9492","last_paid_payment_id":"6681b7c7-e68d-46f6-b859-29dcd06c9492","last_paid_payment_created_at":"2018-07-17T19:13:57.796328","user_email":"test6@gmail.com","search_index":"'-976e-01127':9 '35231811009':4C '40bd':14 '4150':8 '46b4':20 '50220ff507ea':16 '5d69':19 '8f898112':18 '8f898112-5d69-46b4-aee0-e901287c3575':17 '9b03':15 'aee0':21 'asd':3B 'b891d74a':6 'b891d74a-ee95':5 'bfa23714':12 'bfa23714-e1dd-40bd-9b03-50220ff507ea':11 'e1dd':13 'e8b4f47':10 'e901287c3575':22 'ee95':7 'qa4':1A 'test6@gmail.com':2B","current_paid_subscription":{"amount": 1000, "customer": {"name": "asd", "email": "test6@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "35231811009"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec2 QA4", "metadata": null, "row_order": 4194304, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 1000.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"ac971ab3-44f4-4e86-889e-b906af84219a","last_payment_data":{"id" : "6681b7c7-e68d-46f6-b859-29dcd06c9492", "status" : "paid", "created_at" : "2018-07-17T19:13:57.796328", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "6681b7c7-e68d-46f6-b859-29dcd06c9492", "status" : "paid", "created_at" : "2018-07-17T19:13:57.796328", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-17T19:13:57.796328"}, 
                        {"id":"9d4b1b7b-97ae-48f4-bcb4-66901bc64937","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":500,"status":"active","paid_at":"2018-07-18T13:57:52.393407","next_charge_at":"2018-08-17T19:02:25.264368","checkout_data":null,"created_at":"2018-07-17T19:02:25.264368","user_id":"f6fa3c8e-ed28-4ad5-ab96-e4276a594bd7","reward_id":"87e91728-04ce-41cb-b0e7-d6c3515a7f1e","amount":500,"project_external_id":"8","reward_external_id":"17","user_external_id":"7","payment_method":"boleto","last_payment_id":"ceba2213-505c-491d-9ff8-c31fa85aa572","last_paid_payment_id":"ceba2213-505c-491d-9ff8-c31fa85aa572","last_paid_payment_created_at":"2018-07-17T19:02:25.264368","user_email":"test5@gmail.com","search_index":"'25727139007':4C '46b4':20 '48f4':8 '4ad5':14 '5d69':19 '66901bc64937':10 '8f898112':18 '8f898112-5d69-46b4-aee0-e901287c3575':17 '97ae':7 '9d4b1b7b':6 '9d4b1b7b-97ae-48f4-bcb4-66901bc64937':5 'ab96':15 'aeaef':3B 'aee0':21 'bcb4':9 'e4276a594bd7':16 'e901287c3575':22 'ed28':13 'f6fa3c8e':12 'f6fa3c8e-ed28-4ad5-ab96-e4276a594bd7':11 'qa4':1A 'test5@gmail.com':2B","current_paid_subscription":{"amount": 500, "customer": {"name": "aeaef", "email": "test5@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "25727139007"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":{"title": "rec1 QA4", "metadata": null, "row_order": 0, "current_ip": "127.0.0.1", "deliver_at": "2018-05-01", "description": "teste", "minimum_value": 500.0, "shipping_options": "free", "maximum_contributions": 0},"current_reward_id":"87e91728-04ce-41cb-b0e7-d6c3515a7f1e","last_payment_data":{"id" : "ceba2213-505c-491d-9ff8-c31fa85aa572", "status" : "paid", "created_at" : "2018-07-17T19:02:25.264368", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "ceba2213-505c-491d-9ff8-c31fa85aa572", "status" : "paid", "created_at" : "2018-07-17T19:02:25.264368", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-17T19:02:25.264368"}, 
                        {"id":"99ca2276-4554-4cce-ac9b-4a30e20c272b","project_id":"8f898112-5d69-46b4-aee0-e901287c3575","credit_card_id":null,"paid_count":1,"total_paid":1000,"status":"active","paid_at":"2018-07-14T14:02:45.429934","next_charge_at":"2018-08-17T18:44:43.759621","checkout_data":null,"created_at":"2018-07-17T18:44:43.759621","user_id":"19c9e688-34c3-40cc-9b15-fc3d9fadd3ff","reward_id":null,"amount":1000,"project_external_id":"8","reward_external_id":null,"user_external_id":"6","payment_method":"boleto","last_payment_id":"67569253-a219-4eb3-ac25-210c18b04f1b","last_paid_payment_id":"67569253-a219-4eb3-ac25-210c18b04f1b","last_paid_payment_created_at":"2018-07-17T18:44:43.759621","user_email":"test4@gmail.com","search_index":"'-4':8 '-4554':7 '19c9e688':14 '19c9e688-34c3-40cc-9b15-fc3d9fadd3ff':13 '34c3':15 '40cc':16 '46b4':22 '4a30e20c272b':12 '55389246020':5C '5d69':21 '8f898112':20 '8f898112-5d69-46b4-aee0-e901287c3575':19 '99ca2276':6 '9b15':17 'ac9b':11 'aee0':23 'asidj':4B 'cce':10 'cce-ac9b-4a30e20c272b':9 'e901287c3575':24 'fc3d9fadd3ff':18 'qa4':1A 'test':3B 'test4@gmail.com':2B","current_paid_subscription":{"amount": 1000, "customer": {"name": "Test asidja", "email": "test4@gmail.com", "phone": {"ddd": "12", "ddi": "55", "number": "123123123"}, "address": {"city": "Catas", "state": "SS", "street": "Rua Migué", "country": "Tutuama", "zipcode": "12312-123", "neighborhood": "Blah City", "complementary": "123", "street_number": "123"}, "document_number": "55389246020"}, "anonymous": false, "current_ip": "127.0.0.1", "payment_method": "boleto", "is_international": false},"current_reward_data":null,"current_reward_id":null,"last_payment_data":{"id" : "67569253-a219-4eb3-ac25-210c18b04f1b", "status" : "paid", "created_at" : "2018-07-17T18:44:43.759621", "payment_method" : "boleto", "refused_at" : null, "next_retry_at" : null},"last_paid_payment_data":{"id" : "67569253-a219-4eb3-ac25-210c18b04f1b", "status" : "paid", "created_at" : "2018-07-17T18:44:43.759621", "payment_method" : "boleto"},"last_payment_data_created_at":"2018-07-17T18:44:43.759621"}];

        
        return [data, data2].concat(allData);
    };

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/subscriptions)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(SubscriptionMockery())
    });
});