wordjelly-auth 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/auth/admin_create_users_controller.rb +7 -9
- data/app/controllers/auth/application_controller.rb +1 -3
- data/app/controllers/auth/concerns/devise_concern.rb +5 -4
- data/app/controllers/auth/concerns/otp_concern.rb +7 -4
- data/app/controllers/auth/concerns/token_concern.rb +22 -10
- data/app/controllers/auth/profiles_controller.rb +1 -1
- data/app/controllers/auth/registrations_controller.rb +1 -7
- data/app/controllers/auth/sessions_controller.rb +0 -3
- data/app/models/auth/concerns/chief_model_concern.rb +1 -1
- data/app/models/auth/concerns/notification_concern.rb +0 -2
- data/app/models/auth/concerns/user_concern.rb +7 -6
- data/app/views/layouts/auth/navbar/_personalization.html.erb +0 -2
- data/config/initializers/devise.rb +16 -16
- data/config/initializers/omniauth.rb +11 -5
- data/lib/auth/notify.rb +1 -2
- data/lib/auth/two_factor_otp.rb +4 -0
- data/lib/auth/version.rb +1 -1
- data/lib/wordjelly-auth.rb +1 -1
- data/spec/dummy/app/assets/time_hashes.json +1 -1
- data/spec/dummy/app/controllers/topics_controller.rb +1 -1
- data/spec/dummy/app/models/noti.rb +1 -1
- data/spec/dummy/app/models/user.rb +2 -2
- data/spec/dummy/log/development.log +17 -0
- data/spec/dummy/log/test.log +97083 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-0/-0dhrbY0GyOP-OwMgYIoIwx08gxlWeB6nRLgtQ-vhUs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-G/-G1nXy4LnP-1padJXRMq0gYex3KxVr9FeHvyjFhOxns.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-c/-coZ9HrDBKWXMOPzHQVobptnxra-S-bwIwCqc_4IiEU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0S/0S3TQXmQdcOoHVbm1lf3TXSdtYp_W9PSeWflwASp-_U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/12/12_GSJot0s_T9zQsZt4TwgVW7YyTAV1rOrKkMosmAqY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1U/1UcxcfcuuCi9V2eLzHmN0pyZTSdxjJePikHzuaBGsWE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1Z/1Z79eTYT4t733p8ELTIx1wetBTnyxNNk3wIMFXloO1M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1l/1lAmfBOdE8qRt9QMyGJDrt-FXCNUu9t9m2BtsGi8H-I.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2T/2TCws4S9Q-TMgaH2pMlm-gKyxIr0-DrRA7JDOI_5wS8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/31/31B_xMNizeQWxBfgWMxFwI19bbfTytpJFiXeoSOPuj8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3K/3KNpL9z0AyalQsOSPsnGkQEC2_lv54OQ8k2z92XHDk4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3q/3qusNC-PNAGtm0tVoy-OLbW0l6NDBnbr8h6HsC6-ZwE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/40/40rH5cWLu9P-Ka9eaXaYLsiIMwo0lQU1uKJl87mmqp4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4k/4kGl3mzGAVt3OQrHipVrCTvobMGiNw1C3TAlM8d0jSo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5_/5_rNjsUQIG1kvx0Ea14xFiVUNZw-fQiCKFADtCUISl8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6P/6P2BRzaGXxd5wvxr6sWwgI1bZICtHCFMI6zQ_oZiOqk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7Y/7Y5LlLib_2JVdHyBWTD2jJE15HH6mBMmn-fO-4JFNVs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7u/7uFX_6SUih4Vpv_8-ugk1H7JpDXz1IvTpXI17HuSTbI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8J/8Jhgr_yvG58NUJCygqXHwkCHERvoyHhPOg10bYQy5nQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8f/8foX5tYCyoYFpUsCT34-Bf6TpNNT6Kwd-XTv6aPxOhI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8t/8toCJcqwv4i9gl6liTXuXpsxiNatE-evUDcbHr0tz94.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BD/BDfByD14hJgYaN0eTEfiFeGlD7GbA_ABSzDr6dSOgMk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Bm/BmxJ5hMgr895pNBjWTXQDZBmV9BrSKILRBSs__eihb4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cc/CcHTIg-2JC1vRhuCXNydi-RfjziOF5qO8kYLj-HzoUA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cn/CnoShxpzz96vNVTeBqxA2k8ZBfnNHzHn2xIA7bD2jY4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DJ/DJKxp6-JgYXtFs0yhhjItwnj36wnlH0uS6GOnpL4BN0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/D_/D_u3Rxnx5qB5j2rhRR0v7Fypt8j58ogFbmjh9QaL5Uc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Do/Dot0LXvqeMyL06wXeUn8DLrURrTztIy1318Qraz4tNo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dz/Dz46sWpT9Is5wx29ihmFC0gW0wHKHFegvszl-ATyr04.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/E5/E5SBLFshplGNpTsaq2qbuLDLGUW5NX0W6G08orTEfb8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/EB/EB3VH7Aqwf_pxOVmUvf4deSn_EF_00Pbs0aU-KVKrLU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/EW/EW0mRGtnT3pbtHOhXnmfGFACMcet5Ga3wX7LvUZSub4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ev/Evd9M2zuKBBZJtuyjN_JKq5YMjyO87lr9NXlImL4t0E.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F3/F3cZpkXnVS38KNxVg6GYRDXmAhGGY-40g1S6QS5xKnk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FY/FYMgeP_Bepfhv0u1xl0hcX3MyToXAa-jRzAFaX2eQ1w.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Fw/FwhDpPgbwLhSrMMUdzy_-ttvTTgXxEeDPefOGFfVVjg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Fy/Fy9KYLBKO9dWxdcBNt4x1fu0Alk2d2bMSKfyVVxnEIU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/G8/G8iu2dUItlF_pydVrIJh_wgC5atY6t_4tH1xoLHLrDc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/J0/J0CfxOVkHAsR5OERX2QgPn-oNRq_1fAHhxavuGwpfJw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jc/Jc4nbds2iZUXo6dLvnHTM0olhT_NCm6w2VDKk_Wicx0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Kq/KqrOZcHCPbn2wl5itOoIuGSL3lHJGjLnlNNiGqKSXik.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LQ/LQRU7cqg6V9X5aetvUuLDZZn9nenW6SI-QzOKP5sCL0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lh/Lhl-3xF9pdODkFXSR0hrvXmI6ZAkvdbXxCPzAZnV5y4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lx/Lxs71Xh2V4O2qeyWbuEPCmkJfsRdlk13ONaYrE1n9wA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M-/M-xkCBgmq32eL5JZqjIxK6wtQXUq23nGa1XLpcuu1Qw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MK/MKZHzwCTzUN-wws9EwIUjppigKorRPKR9ZbtE92ayU8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MP/MPCPCXoDkqVYMarTQI6SHWsf6cnohji9-BQr4jK4HgE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NI/NI8qTKlBTJSRWwzDbRgXHQdclFZkYdOCjnSubTsR8q0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NZ/NZt2Fk8fjqCa38WUuIm3SVNE9pLABVJcLMwA73Aj75k.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nm/NmKt9xXes3qjjL7qBoOgOfm3MzxgoF-bcIOSScOEj_A.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OC/OCgU2H6mmLE7R1ly2ISlkKWR00THjG4oZpOICXgS6So.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PB/PB-PxUvSlCbndtGCq5I-hPKgHO7TKMFukbldi6MnQA4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PB/PBHtjw1AR4rCnSGQ5LaH5J3n3z0lLq2y6UTj7Z0Pwtk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PT/PTgdtSaUOPELoOtDA34Sw4804A_el4Dm2j0rRA7cnFU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pq/PqVW--mUwbLir-XGjudr-ErZ6D9yfMsiYB6izLt0N8c.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pt/PtM54QYZqornlZVQzg4zcRESJBwc1sqqkTaSNsmNcAs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q3/Q3CyfZaRjU5DIQuBAAhQOELbbj2DLEoFW_yKj_1hobQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qv/QvTX_ppHbQG831XEDjBaxwq8CAjBVaLFNvY5xANghb4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qy/QyNeUuf3eE6ueqjRzWvtO4N93QgQnuQNc7B8yk8HYs4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RG/RGKD9rejvAJ0vOZYPxeU7ahImQUQ-Z4lmlm7sF3dLkg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Rs/Rs9BnF25JQdTl4JaucXLu0xkTuJ3ejZFt3A_D25zXqQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SV/SVkbUossZ05MhBUc3oKmndn5ZOKrfUXYmiFcADiGctI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Si/SiiD3tf3KNQA5hnNKIkL--jUSORyEVH7mUmjBN4z9ic.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T1/T1nKgCtKoK7k7opWfcmRpkyetldn-pb1ZhbRjluCy2I.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ti/TieOlds8L-CqvMqVFup3GtbotBBsO0q-6_gNt9zTFGo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Un/UnGq_QfVsYWG6no7Jgp0uPY-gCpasdjwNRUrqbaMNAI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Uw/Uw-q52a_hUiyV6sSnGaYy2db4clS3pvnzG1TKRbpL8Y.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Uy/UyWRUz3W6gylcdAVgiRRpaUZL4O5miHh4jmX7o-1xg4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VI/VIonoCAtoPJEHyodwQkwp611LZtr3jHG4LzC-F1hF84.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vh/VhxsJpfat6UsgoVQCQg1Ym2FYDXUOH78NLF3d0FuJS4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vn/VnIG8lgvhZr2Si37Q-bUrMpVb_zDw_7uMKITTO-ovU0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vv/VvQbcrRv_qDg5JPUweKJ-vcVRJDgkkuOHioRSsKEEbc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WJ/WJ-e2Z8tTnmWXlQXwUI8EZnB90yGiFMYtTfxpK2gOvU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Wn/WnkRWDYrvGLVMSb-D3I7dmRiIwFqpXNm38q9fJERlCk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X3/X3smAVji-ukCfsZEDAxoOZLpw8mT4Mj-fAbNVG9-9bQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X9/X9b8M0d2usej58k1zoDmbBdjSdBhN0x1QtWhmnh-JG4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Y9/Y9aAK1BuseBw1dCFf7663-37yVBgaRYvksiZ2KJSfvk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YJ/YJdLwUSTqw6BkhdtdMgfjMSdelN2-81K7efXUW6jRJU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YS/YSq1BFD3X5FC7M_habJoT5avPD2YdPLqr0sR1wWWAvk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ye/Yeod13x4QZ_yg24AXWAplizzEeT4vmYpFaW-8ByTAyI.cache +4 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zl/Zl-FTV4vKa2r3nBU7NRBdlkyRgcIo7NOyqsfaqdX_fg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zz/ZzHkXwTsIIQP9RxHuaUK5e7dLIn-97MEMx4FIMfTeQ4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_p/_pMJDnS03nKNwhX6yRLzcNGVCbhacORKScShrSx7MxI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_p/_pS1zE8_3SWBv08G8D0PbOrKWwWlu1J-10DIcKTkgO0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aU/aUdedQfJRE4WM1yhkBqntdEdsLi9Afvy4vJCZT_HC1o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aW/aWvPO8gLdbq7hPlaVWsmAjqBaF8YSdYy037mMDXW4Tg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ai/aif0HXHTP8TTkJLP5WgJJWRX-3WuhyXitAQqKggdkcI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bZ/bZTOj3FkHGhajkYgEen2owanSvTPSosjpiW1XxECilw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/c6/c6AR_6VzNekyDzXLdRhwvHoXWWbn09mT5UNPBqF8UpA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/c_/c_h7t7u_rFR3KnBBfzFsDc4YAUt0EZTw96CPQ1kLFf8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cm/cmQOyDMGQlBXxS-cEfW3ybQyDtYbA_ELFjyA2HMV7rs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cs/csUv0EfXstJ9ICGSfTaFbGDO-dOXno_sHKVEKyM_Nhc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dH/dHiZ5z2yXwZwOieEvpwWUUaKghyAC0iCIjW2q2kVeUE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dJ/dJRQPj1XGX75PaQ17AgiKl5kyCK6bV7ylMbbMqbXuco.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dZ/dZMQcf9OWIgXcTJCJ1GTVDVe19S9ZgiG_1e1a780d_Q.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dq/dqNP-F6bmkWZMlXgf-329jtqOGCKF2oXUvNr5bhPbQE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dz/dzuY7AKX-enWr0rYgYH4OXHi-LBvc0isw5ie0yO45e4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/f8/f88N5DXkOKgPc-nGhMPxgpspka0NaeEVCBzGvwaE8BM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fa/faDulrH9S1Be0m8ztxG5g5ynbRBVxf70wOB6vrVMywE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gp/gpFDoJpjw_aE4DhvaqWOaFhXiqIvF0WSfjTnl8Q3G0U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/im/im4F5IlDskeBDAqDQULkPwTLhrSZJ_tYk1TmHmRujjg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iv/ivDNGgRa-TXRJNXFJu1KUl5gfJXv6A3HJck8dhCMDrs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ix/ixuoKIlw0Kp3KfosOL87jmUF47SvtIQB-3P-Klex8go.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jc/jcHgYxE_SR00sIQslkTchNwH3zBVkUuEI8ePXqylmHQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jl/jlRTXjvTvwfw694lhUYco9VNQ5p9wUZjcNZPw4DBkH4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/k3/k35ajM7sLMUFU8Q0Eicz8ll4aAuVA7vaOR2ZZRKYl6M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/l-/l-AjdVtB_eIbbSI8T3oY9RxX6MaokgElNwezpCrU0tc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nL/nLc7sVZTvR9ZySmCVbOm3L11K3OIFglLjTfR_wfqP1Y.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nN/nNDg8M6LNx27UKt--_qjy5w3B3w2ZQXfVHofJ_9iOIc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/o8/o8zU5S5FxBlyHKTWbAxaZSS96PBkQFKJtsQpJGhPevk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/o9/o9gxmoLOIG_-nCNB7oRpVgRr6i--xBUWFKgKjtKV2sc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oR/oRrswfAuldTZ9brG64pYLewt9Zi99QOmMXZ0lyGv708.cache +5 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oj/ojEGth9PSl5TGslt-isut9GtJZpuhewIjzV05sVKEkI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pB/pBtiG2EBPXNZ0lpzVX6g6hZKKImEJfIsdNfhJWYX-iw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pO/pO79DiFftJguHoaUHA9OkE73QnTLdyxEs_UwCXXClcg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qI/qIFKqiroYFomfrmRXac4nF_0AsVorETB_bIagFIbkcM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qu/qu6F54GREhiOp_2P6ppQ-8NeZsYlveIvYKQlgXcghts.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r6/r64nn_NhSInz6BbD3EDCK2I-gTTY4g-B0RHgrv_SJ_A.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rA/rAcSMdSYlR0BYo0DfMZrKdbZa-LIFyzsOyUM6tQZ0QA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rf/rfrwzmCwUJdLJ-4vW6Ho4n9OHtskPdrp1Sgxp8nfXO0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sz/szhmMT4rk7_w_vcKplrRBR85_r8aYTZ1E7QjasY2wj0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/t8/t8pUdgZt9yH9zIp1WN65Ir9roY_7kopnPOKJnvc2K3U.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tE/tEAobslXA32fbcT6i-lf-ZgKlWdPkLAUVJHOEq9AhBI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/u9/u9ZAscd165iXfdEDwmQPbzClIh27yl1HRrn-q6t0EI0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uk/uk213HHY3gnm65Jj-SGfFcXcE_Q7YODVkxGDTefhmVw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/um/um5UeEadQEOsdN0EQQ4yZykW5lqFUPQ5_FUjcRFnQGs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v5/v5g7KRwDAbcVPwY2UBAXijZMNgKyeP-OfIsGKP_7cmc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vF/vFVA03FCooxk6TthEgHU4yFupx8t23TwrrmX7J5tCUE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vP/vPke4WY2P8qj5V60qX_NWSeiVn8v2Q6HTwko-0aoa8s.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vv/vv77r1oYAYIEYc9esC2Pm0Yko7f4iiDqQD62ys6nCX4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vz/vzZSiCj2ChRKhiv1haund-oihmd8SXK0ENbEzBEMsF4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yC/yCS_vzjBPPIXrHoNaiFsaH4r4OR6nI9I0i0XnY-ZjvA.cache +0 -0
- data/spec/rails_helper.rb +9 -0
- data/spec/requests/user/additional_login_param_and_email_validation_spec.rb +19 -19
- data/spec/requests/user/admin_create_user_request_spec.rb +51 -25
- data/spec/requests/user/client_request_spec.rb +2 -2
- data/spec/requests/user/confirmation_request_spec.rb +12 -12
- data/spec/requests/user/omniauth_callbacks_request_spec.rb +30 -32
- data/spec/requests/user/otp_basic_flow_request_spec.rb +28 -28
- data/spec/requests/user/password_request_spec.rb +19 -19
- data/spec/requests/user/registration_request_spec.rb +54 -48
- data/spec/requests/user/session_request_spec.rb +28 -30
- data/spec/requests/user/token_request_spec.rb +58 -85
- data/spec/requests/user/unlock_request_spec.rb +8 -8
- data/spec/spec_helper.rb +3 -0
- metadata +205 -57
@@ -54,7 +54,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
54
54
|
|
55
55
|
it " -- on creating unconfirmed user with a mobile number, it sends otp -- " do
|
56
56
|
|
57
|
-
post user_registration_path, {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
57
|
+
post user_registration_path, params: {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
58
58
|
@user_created = assigns(:user)
|
59
59
|
@cl = assigns(:client)
|
60
60
|
user_json_hash = JSON.parse(response.body)
|
@@ -62,12 +62,12 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
62
62
|
|
63
63
|
end
|
64
64
|
|
65
|
-
it " -- accepts otp at the verify otp endpoint -- " do
|
65
|
+
it " -- accepts otp at the verify otp endpoint -- ", :accept_test => true do
|
66
66
|
|
67
67
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
68
68
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
69
69
|
|
70
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),
|
70
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: {:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"},headers: @headers
|
71
71
|
user_json_hash = JSON.parse(response.body)
|
72
72
|
|
73
73
|
expect(user_json_hash.keys).to match_array(["nothing"])
|
@@ -76,7 +76,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
76
76
|
it " -- short polls for verification status, returns verified true", :one_test => true do
|
77
77
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
78
78
|
|
79
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
79
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
80
80
|
user_json_hash = JSON.parse(response.body)
|
81
81
|
puts user_json_hash.to_s
|
82
82
|
expect(user_json_hash["verified"]).to eq(true)
|
@@ -98,7 +98,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
98
98
|
end
|
99
99
|
it " -- on creating unconfirmed user with a mobile number, it sends otp -- " do
|
100
100
|
|
101
|
-
post user_registration_path, {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
101
|
+
post user_registration_path, params: {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
102
102
|
@user_created = assigns(:user)
|
103
103
|
@cl = assigns(:client)
|
104
104
|
user_json_hash = JSON.parse(response.body)
|
@@ -109,7 +109,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
109
109
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
110
110
|
old_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
111
111
|
|
112
|
-
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
112
|
+
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
113
113
|
|
114
114
|
new_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
115
115
|
|
@@ -124,7 +124,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
124
124
|
|
125
125
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
126
126
|
|
127
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
127
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
128
128
|
user_json_hash = JSON.parse(response.body)
|
129
129
|
|
130
130
|
expect(user_json_hash.keys).to match_array(["nothing"])
|
@@ -133,7 +133,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
133
133
|
it " -- short polls for verification status, returns verified true" do
|
134
134
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
135
135
|
session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
136
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
136
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
137
137
|
user_json_hash = JSON.parse(response.body)
|
138
138
|
|
139
139
|
expect(user_json_hash["verified"]).to eq(true)
|
@@ -143,7 +143,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
143
143
|
it " -- does not return verified true if there are errors from the short polling endpoint " do
|
144
144
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
145
145
|
$redis.hset(@last_user_created.id.to_s + "_two_factor_sms_otp","error","some bloody error")
|
146
|
-
get otp_verification_result_url({:resource => "users",:user => {:_id => @last_user_created.id.to_s, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
146
|
+
get otp_verification_result_url({:resource => "users",:user => {:_id => @last_user_created.id.to_s, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
147
147
|
user_json_hash = JSON.parse(response.body)
|
148
148
|
expect(user_json_hash["resource"].keys).not_to include("authentication_token","es")
|
149
149
|
expect(user_json_hash["verified"]).to eq(false)
|
@@ -153,7 +153,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
153
153
|
it " -- processes short polling endpoint without api_key and current_app_id " do
|
154
154
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
155
155
|
|
156
|
-
get otp_verification_result_url({:resource => "users",:user => {:_id => @last_user_created.id.to_s, :otp => $otp_session_id},:api_key => @ap_key}),nil
|
156
|
+
get otp_verification_result_url({:resource => "users",:user => {:_id => @last_user_created.id.to_s, :otp => $otp_session_id},:api_key => @ap_key}),params: nil,headers: @headers
|
157
157
|
|
158
158
|
|
159
159
|
expect(response.body).not_to be_empty
|
@@ -178,7 +178,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
178
178
|
end
|
179
179
|
it " -- on creating unconfirmed user with a mobile number, it sends otp -- " do
|
180
180
|
|
181
|
-
post user_registration_path, {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
181
|
+
post user_registration_path, params: {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
182
182
|
@user_created = assigns(:user)
|
183
183
|
@cl = assigns(:client)
|
184
184
|
user_json_hash = JSON.parse(response.body)
|
@@ -189,7 +189,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
189
189
|
Auth.configuration.simulate_invalid_otp = true
|
190
190
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
191
191
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
192
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
192
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
193
193
|
user_json_hash = JSON.parse(response.body)
|
194
194
|
|
195
195
|
expect(user_json_hash.keys).to match_array(["nothing"])
|
@@ -198,7 +198,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
198
198
|
it " -- short polls for verification status returns verified false" do
|
199
199
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
200
200
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
201
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
201
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
202
202
|
user_json_hash = JSON.parse(response.body)
|
203
203
|
expect(user_json_hash["verified"]).to eq(false)
|
204
204
|
expect(user_json_hash["resource"]).not_to include("authentication_token","es")
|
@@ -234,10 +234,10 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
234
234
|
last_user_created.save
|
235
235
|
last_user_created.email = "rihanna@gmail.com"
|
236
236
|
last_user_created.save
|
237
|
-
last_user_created.confirm
|
237
|
+
last_user_created.confirm
|
238
238
|
|
239
239
|
|
240
|
-
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),nil
|
240
|
+
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),params: nil,headers: @headers
|
241
241
|
|
242
242
|
user_json_hash = JSON.parse(response.body)
|
243
243
|
#puts user_json_hash.to_s
|
@@ -249,7 +249,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
249
249
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
250
250
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
251
251
|
|
252
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
252
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
253
253
|
user_json_hash = JSON.parse(response.body)
|
254
254
|
|
255
255
|
expect(user_json_hash.keys).to match_array(["nothing"])
|
@@ -258,7 +258,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
258
258
|
##then to short poll with the intent token
|
259
259
|
it " -- short polls for verification status, this time with an intent and an intent token, and verified as true" do
|
260
260
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
261
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),nil
|
261
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),params: nil,headers: @headers
|
262
262
|
user_json_hash = JSON.parse(response.body)
|
263
263
|
##here check to see if a reset password email was sent.
|
264
264
|
message = ActionMailer::Base.deliveries[-1].to_s
|
@@ -289,7 +289,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
289
289
|
|
290
290
|
it " -- on creating unconfirmed user with a mobile number, it sends otp -- " do
|
291
291
|
|
292
|
-
post user_registration_path, {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
292
|
+
post user_registration_path, params: {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
293
293
|
@user_created = assigns(:user)
|
294
294
|
@cl = assigns(:client)
|
295
295
|
user_json_hash = JSON.parse(response.body)
|
@@ -302,7 +302,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
302
302
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
303
303
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
304
304
|
|
305
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
305
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
306
306
|
user_json_hash = JSON.parse(response.body)
|
307
307
|
|
308
308
|
expect(user_json_hash.keys).to match_array(["nothing"])
|
@@ -312,7 +312,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
312
312
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
313
313
|
|
314
314
|
|
315
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
315
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
316
316
|
user_json_hash = JSON.parse(response.body)
|
317
317
|
|
318
318
|
expect(user_json_hash["verified"]).to eq(true)
|
@@ -325,7 +325,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
325
325
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
326
326
|
|
327
327
|
|
328
|
-
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),nil
|
328
|
+
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),params: nil,headers: @headers
|
329
329
|
|
330
330
|
user_json_hash = JSON.parse(response.body)
|
331
331
|
|
@@ -337,7 +337,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
337
337
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
338
338
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
339
339
|
|
340
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
340
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
341
341
|
user_json_hash = JSON.parse(response.body)
|
342
342
|
|
343
343
|
expect(user_json_hash.keys).to match_array(["nothing"])
|
@@ -346,7 +346,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
346
346
|
##then to short poll with the intent token
|
347
347
|
it " -- short polls for verification status, this time with an intent ,returns the reset password url, and verified as true" do
|
348
348
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
349
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),nil
|
349
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid", :intent => "reset_password"}),params: nil,headers: @headers
|
350
350
|
user_json_hash = JSON.parse(response.body)
|
351
351
|
##here check to see if a reset password email was sent.
|
352
352
|
expect(user_json_hash["verified"]).to eq(false)
|
@@ -387,11 +387,11 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
387
387
|
|
388
388
|
a = {:id => last_user_created.id.to_s, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, api_key: @ap_key, :current_app_id => "testappid"}
|
389
389
|
|
390
|
-
put user_registration_path, a.to_json
|
390
|
+
put user_registration_path, params: a.to_json,headers: @headers.merge({"X-User-Token" => last_user_created.authentication_token, "X-User-Es" => last_user_created.client_authentication["testappid"], "X-User-Aid" => "testappid"})
|
391
391
|
@user_updated = assigns(:user)
|
392
392
|
##manually confirm the email.
|
393
393
|
@last_user_created = User.find(last_user_created.id)
|
394
|
-
@last_user_created.confirm
|
394
|
+
@last_user_created.confirm
|
395
395
|
@last_user_created.save
|
396
396
|
|
397
397
|
expect(@last_user_created.email).to eq("rihanna@gmail.com")
|
@@ -404,7 +404,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
404
404
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
405
405
|
|
406
406
|
|
407
|
-
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid", :intent => "unlock_account"}),nil
|
407
|
+
get send_sms_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param},:api_key => @ap_key, :current_app_id => "testappid", :intent => "unlock_account"}),params: nil,headers: @headers
|
408
408
|
|
409
409
|
user_json_hash = JSON.parse(response.body)
|
410
410
|
|
@@ -417,7 +417,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
417
417
|
@last_user_created = User.order_by(:confirmation_sent_at => 'desc').first
|
418
418
|
$otp_session_id = $redis.hget(@last_user_created.id.to_s + "_two_factor_sms_otp","otp_session_id")
|
419
419
|
|
420
|
-
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),nil
|
420
|
+
get verify_otp_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid"}),params: nil,headers: @headers
|
421
421
|
user_json_hash = JSON.parse(response.body)
|
422
422
|
|
423
423
|
|
@@ -433,7 +433,7 @@ RSpec.describe "OTP flow requests", :otp => true,:authentication => true, :type
|
|
433
433
|
|
434
434
|
|
435
435
|
|
436
|
-
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid", :intent => "unlock_account"}),nil
|
436
|
+
get otp_verification_result_url({:resource => "users",:user => {:additional_login_param => @last_user_created.additional_login_param, :otp => $otp_session_id},:api_key => @ap_key, :current_app_id => "testappid", :intent => "unlock_account"}),params: nil,headers: @headers
|
437
437
|
user_json_hash = JSON.parse(response.body)
|
438
438
|
|
439
439
|
|
@@ -35,14 +35,14 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
35
35
|
|
36
36
|
it "-- get request is successfull" do
|
37
37
|
|
38
|
-
get new_user_password_path,{}
|
38
|
+
get new_user_password_path,params: {}
|
39
39
|
expect(response.code).to eq("200")
|
40
40
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "-- create request is successfull" do
|
44
44
|
|
45
|
-
post user_password_path,{user: {email: @u.email}}
|
45
|
+
post user_password_path,params: {user: {email: @u.email}}
|
46
46
|
expect(response.code).to eq("302")
|
47
47
|
expect(response).to redirect_to(new_user_session_path)
|
48
48
|
|
@@ -53,7 +53,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
53
53
|
it "-- update request is successfull" do
|
54
54
|
|
55
55
|
old_password = @u.encrypted_password
|
56
|
-
post user_password_path, user: {email: @u.email}
|
56
|
+
post user_password_path, params: {user: {email: @u.email}}
|
57
57
|
message = ActionMailer::Base.deliveries[-1].to_s
|
58
58
|
#puts message.to_s
|
59
59
|
reset_password_token = nil
|
@@ -67,11 +67,11 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
67
67
|
#reset_password_token = message[rpt_index...message.index(" ", rpt_index)]
|
68
68
|
#puts "the reset password token is: #{reset_password_token}"
|
69
69
|
puts "reset password token is : #{reset_password_token}"
|
70
|
-
put user_password_path, user: {
|
70
|
+
put user_password_path, params: {user: {
|
71
71
|
reset_password_token: reset_password_token,
|
72
72
|
password: "newpassword",
|
73
73
|
password_confirmation: "newpassword",
|
74
|
-
}
|
74
|
+
}}
|
75
75
|
@u.reload
|
76
76
|
expect(@u.encrypted_password).not_to eq(old_password)
|
77
77
|
expect(@u.errors.full_messages).to be_empty
|
@@ -85,7 +85,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
85
85
|
|
86
86
|
it "-- get request does not redirect to redirect url" do
|
87
87
|
|
88
|
-
get new_user_password_path,{redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
88
|
+
get new_user_password_path, params: {redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
89
89
|
expect(session[:client]).not_to be_nil
|
90
90
|
expect(session[:redirect_url]).not_to be_nil
|
91
91
|
expect(response.code).to eq("200")
|
@@ -94,7 +94,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
94
94
|
|
95
95
|
it " -- create request does not redirect to redirect url" do
|
96
96
|
|
97
|
-
post user_password_path,{user: {email: @u.email}, redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
97
|
+
post user_password_path,params: {user: {email: @u.email}, redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
98
98
|
expect(session[:client]).not_to be_nil
|
99
99
|
expect(session[:redirect_url]).not_to be_nil
|
100
100
|
expect(response.code).to eq("302")
|
@@ -106,7 +106,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
106
106
|
it "-- update request does not redirect to redirect url" do
|
107
107
|
|
108
108
|
old_password = @u.encrypted_password
|
109
|
-
post user_password_path, user: {email: @u.email}, current_app_id: @c.app_ids[0], redirect_url: "http://www.google.com"
|
109
|
+
post user_password_path, params: {user: {email: @u.email}, current_app_id: @c.app_ids[0], redirect_url: "http://www.google.com"}
|
110
110
|
message = ActionMailer::Base.deliveries[-1].to_s
|
111
111
|
reset_password_token = nil
|
112
112
|
message.scan(/reset_password_token=(?<password_token>.*)\"/) do |ll|
|
@@ -116,7 +116,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
116
116
|
|
117
117
|
end
|
118
118
|
|
119
|
-
put user_password_path, {user: {
|
119
|
+
put user_password_path, params: {user: {
|
120
120
|
reset_password_token: reset_password_token,
|
121
121
|
password: "newpassword",
|
122
122
|
password_confirmation: "newpassword",
|
@@ -137,13 +137,13 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
137
137
|
context "-- no api key" do
|
138
138
|
|
139
139
|
it "-- get request returns not authorized" do
|
140
|
-
get new_user_password_path,nil
|
140
|
+
get new_user_password_path,params: nil,headers: @headers
|
141
141
|
expect(response.code).to eq("406")
|
142
142
|
end
|
143
143
|
|
144
144
|
|
145
145
|
it "-- create request returns not authorized" do
|
146
|
-
post user_password_path,{user: {email: @u.email}}.to_json
|
146
|
+
post user_password_path,params: {user: {email: @u.email}}.to_json,headers: @headers
|
147
147
|
expect(response.code).to eq("401")
|
148
148
|
end
|
149
149
|
|
@@ -151,7 +151,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
151
151
|
it "-- update request returns not authorized" do
|
152
152
|
old_password = @u.encrypted_password
|
153
153
|
ActionController::Base.allow_forgery_protection = false
|
154
|
-
post user_password_path,{user: {email: @u.email}}
|
154
|
+
post user_password_path,params: {user: {email: @u.email}}
|
155
155
|
ActionController::Base.allow_forgery_protection = true
|
156
156
|
message = ActionMailer::Base.deliveries[-1].to_s
|
157
157
|
reset_password_token = nil
|
@@ -161,11 +161,11 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
161
161
|
reset_password_token = j[:password_token]
|
162
162
|
|
163
163
|
end
|
164
|
-
put user_password_path, {user: {
|
164
|
+
put user_password_path, params: {user: {
|
165
165
|
reset_password_token: reset_password_token,
|
166
166
|
password: "newpassword",
|
167
167
|
password_confirmation: "newpassword",
|
168
|
-
}}.to_json
|
168
|
+
}}.to_json,headers: @headers
|
169
169
|
expect(response.code).to eq("401")
|
170
170
|
end
|
171
171
|
|
@@ -175,13 +175,13 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
175
175
|
context "-- valid api key" do
|
176
176
|
|
177
177
|
it "-- get request succeeds" do
|
178
|
-
get new_user_password_path,{api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
178
|
+
get new_user_password_path, params: {api_key: @ap_key, current_app_id: @c.app_ids[0]}, headers: @headers
|
179
179
|
expect(response.code).to eq("406")
|
180
180
|
end
|
181
181
|
|
182
182
|
|
183
183
|
it "-- create request succeeds" do
|
184
|
-
post user_password_path,{user: {email: @u.email}, current_app_id: @c.app_ids[0] ,api_key: @ap_key}.to_json
|
184
|
+
post user_password_path,params: {user: {email: @u.email}, current_app_id: @c.app_ids[0] ,api_key: @ap_key}.to_json,headers: @headers
|
185
185
|
expect(response.code).to eq("201")
|
186
186
|
|
187
187
|
end
|
@@ -189,7 +189,7 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
189
189
|
it "-- update request succeeds" do
|
190
190
|
|
191
191
|
old_password = @u.encrypted_password
|
192
|
-
post user_password_path,{user: {email: @u.email}, current_app_id: @c.app_ids[0], api_key: @ap_key}.to_json
|
192
|
+
post user_password_path,params: {user: {email: @u.email}, current_app_id: @c.app_ids[0], api_key: @ap_key}.to_json,headers: @headers
|
193
193
|
message = ActionMailer::Base.deliveries[-1].to_s
|
194
194
|
reset_password_token = nil
|
195
195
|
message.scan(/reset_password_token=(?<password_token>.*)\"/) do |ll|
|
@@ -198,11 +198,11 @@ RSpec.describe "password request spec", :type => :request, :authentication => tr
|
|
198
198
|
reset_password_token = j[:password_token]
|
199
199
|
|
200
200
|
end
|
201
|
-
put user_password_path, {user: {
|
201
|
+
put user_password_path, params: {user: {
|
202
202
|
reset_password_token: reset_password_token,
|
203
203
|
password: "newpassword",
|
204
204
|
password_confirmation: "newpassword",
|
205
|
-
}, redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}.to_json
|
205
|
+
}, redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}.to_json,headers: @headers
|
206
206
|
@u.reload
|
207
207
|
expect(@u.encrypted_password).not_to eq(old_password)
|
208
208
|
expect(@u.errors.full_messages).to be_empty
|
@@ -49,10 +49,10 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
49
49
|
|
50
50
|
|
51
51
|
it " -- does not need an api_key in the params -- ", :init => true do
|
52
|
-
get new_user_registration_path
|
53
|
-
|
54
|
-
expect(@user).not_to be_nil
|
55
|
-
expect(@user.errors.full_messages).to be_empty
|
52
|
+
#get new_user_registration_path
|
53
|
+
#@user = assigns(:user)
|
54
|
+
#expect(@user).not_to be_nil
|
55
|
+
#expect(@user.errors.full_messages).to be_empty
|
56
56
|
|
57
57
|
end
|
58
58
|
|
@@ -65,14 +65,14 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
65
65
|
after(:example) do
|
66
66
|
Recaptcha.configuration.skip_verify_env << "test"
|
67
67
|
end
|
68
|
-
it " -- requires recaptcha on create " do
|
69
|
-
post user_registration_path, {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}
|
68
|
+
it " -- requires recaptcha on create ", :ft => true do
|
69
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}
|
70
70
|
expect(response.body).to eq("recaptcha validation error")
|
71
71
|
end
|
72
72
|
|
73
|
-
it " -- requires recaptcha on update " do
|
73
|
+
it " -- requires recaptcha on update ", :ft_two => true do
|
74
74
|
sign_in_as_a_valid_and_confirmed_user
|
75
|
-
put user_registration_path, :id => @user.id, :user => {:email => "dog@gmail.com", :current_password => "password"},:api_key => @ap_key, :current_app_id => "testappid"
|
75
|
+
put user_registration_path, params: {:id => @user.id, :user => {:email => "dog@gmail.com", :current_password => "password"},:api_key => @ap_key, :current_app_id => "testappid"}
|
76
76
|
expect(response.body).to eq("recaptcha validation error")
|
77
77
|
end
|
78
78
|
|
@@ -81,7 +81,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
81
81
|
context " -- creates user with name, age, date_of_birth etc -- ", :creates_user_with_name_dob_sex => true do
|
82
82
|
|
83
83
|
it " -- -- " do
|
84
|
-
post user_registration_path, {user: attributes_for(:user_confirmed).merge({:first_name => "Radhika", :last_name => "Joshi", :date_of_birth => "10/10/1988", :sex => "Female"}),:api_key => @ap_key, :current_app_id => "testappid"}
|
84
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed).merge({:first_name => "Radhika", :last_name => "Joshi", :date_of_birth => "10/10/1988", :sex => "Female"}),:api_key => @ap_key, :current_app_id => "testappid"}
|
85
85
|
|
86
86
|
@user = assigns(:user)
|
87
87
|
|
@@ -107,7 +107,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
107
107
|
|
108
108
|
it " -- creates client authentication and auth token on user create -- " do
|
109
109
|
|
110
|
-
post user_registration_path, {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}
|
110
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}
|
111
111
|
@user = assigns(:user)
|
112
112
|
expect(@user.client_authentication).not_to be_nil
|
113
113
|
expect(@user.client_authentication).not_to be_empty
|
@@ -128,11 +128,11 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
128
128
|
|
129
129
|
##this client authentication will not change, provided that we use the same api key and same current app id.
|
130
130
|
|
131
|
-
put user_registration_path, :id => @user.id, :user => {:email => "dog@gmail.com", :current_password => "password"},:api_key => @ap_key, :current_app_id => cli.current_app_id
|
131
|
+
put user_registration_path, params: {:id => @user.id, :user => {:email => "dog@gmail.com", :current_password => "password"},:api_key => @ap_key, :current_app_id => cli.current_app_id}
|
132
132
|
|
133
133
|
@user_updated = assigns(:user)
|
134
134
|
|
135
|
-
@user_updated.confirm
|
135
|
+
@user_updated.confirm
|
136
136
|
|
137
137
|
expect(@user_updated.errors.full_messages).to be_empty
|
138
138
|
expect(@user_updated.email).not_to eql(@user.email)
|
@@ -152,7 +152,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
152
152
|
|
153
153
|
first_name = Faker::Name.name
|
154
154
|
|
155
|
-
put user_registration_path, :id => @user.id, :user => {:first_name => first_name, :current_password => "password"}
|
155
|
+
put user_registration_path, params: {:id => @user.id, :user => {:first_name => first_name, :current_password => "password"}}
|
156
156
|
|
157
157
|
@user_updated = assigns(:user)
|
158
158
|
##here don't need to confirm anything because we are not changing the email.
|
@@ -175,7 +175,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
175
175
|
|
176
176
|
c = Auth::Client.all.count
|
177
177
|
## i don't think it will accept this here.
|
178
|
-
post user_registration_path, user: attributes_for(:user_confirmed)
|
178
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed)}
|
179
179
|
user = assigns(:user)
|
180
180
|
user = User.where(:email => user.email).first
|
181
181
|
user.confirmed_at = Time.now
|
@@ -195,7 +195,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
195
195
|
|
196
196
|
user_with_mobile_attrs = attributes_for(:user_mobile)
|
197
197
|
|
198
|
-
post user_registration_path, user: user_with_mobile_attrs
|
198
|
+
post user_registration_path, params: {user: user_with_mobile_attrs}
|
199
199
|
|
200
200
|
user_c = assigns(:user)
|
201
201
|
|
@@ -215,7 +215,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
215
215
|
sign_in_as_a_valid_and_confirmed_user
|
216
216
|
client = Auth::Client.find(@user.id)
|
217
217
|
c = Auth::Client.all.count
|
218
|
-
put user_registration_path, :id => @user.id, :user => {:email => Faker::Internet.email, :current_password => 'password'}
|
218
|
+
put user_registration_path, params: {:id => @user.id, :user => {:email => Faker::Internet.email, :current_password => 'password'}}
|
219
219
|
c1 = Auth::Client.all.count
|
220
220
|
expect(c1-c).to eq(0)
|
221
221
|
expect(client).not_to be_nil
|
@@ -231,7 +231,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
231
231
|
u = User.all.count
|
232
232
|
#puts "DOING DELETE -----------------"
|
233
233
|
#puts @user.attributes.to_s
|
234
|
-
delete user_registration_path, :id => @user.id
|
234
|
+
delete user_registration_path, params: {:id => @user.id}
|
235
235
|
c1 = Auth::Client.all.count
|
236
236
|
u1 = User.all.count
|
237
237
|
#puts "user all count after deleting is: #{u1}"
|
@@ -244,13 +244,13 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
244
244
|
context " -- sets client if api key and current_app_id match -- ", :current_problem => true do
|
245
245
|
|
246
246
|
it " new_user_registration_path -- " do
|
247
|
-
get new_user_registration_path, {:api_key => @ap_key, :current_app_id => "testappid"}
|
247
|
+
get new_user_registration_path, params: {:api_key => @ap_key, :current_app_id => "testappid"}
|
248
248
|
|
249
249
|
expect(session[:client]).not_to be_nil
|
250
250
|
end
|
251
251
|
|
252
252
|
it " create user -- " do
|
253
|
-
post user_registration_path, {user: attributes_for(:user), api_key: @ap_key, current_app_id: "testappid"}
|
253
|
+
post user_registration_path, params: {user: attributes_for(:user), api_key: @ap_key, current_app_id: "testappid"}
|
254
254
|
|
255
255
|
expect(session[:client]).not_to be_nil
|
256
256
|
|
@@ -259,7 +259,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
259
259
|
|
260
260
|
it " update user -- " do
|
261
261
|
sign_in_as_a_valid_and_confirmed_user
|
262
|
-
put user_registration_path, :id => @user.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, :api_key => @ap_key, :current_app_id => "testappid"
|
262
|
+
put user_registration_path, params: {:id => @user.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, :api_key => @ap_key, :current_app_id => "testappid"}
|
263
263
|
@updated_user = assigns(:user)
|
264
264
|
expect(session[:client]).not_to be_nil
|
265
265
|
end
|
@@ -286,7 +286,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
286
286
|
|
287
287
|
it " --(CREATE ACTION) redirects to root path, does not set client or redirect url, but successfully creates the user, only the redirect fails. -- " do
|
288
288
|
|
289
|
-
post user_registration_path, {user: attributes_for(:user), api_key: "invalid api_key", redirect_url: "http://www.google.com", current_app_id: "testappid"}
|
289
|
+
post user_registration_path, params: {user: attributes_for(:user), api_key: "invalid api_key", redirect_url: "http://www.google.com", current_app_id: "testappid"}
|
290
290
|
@user_just_created = assigns(:user)
|
291
291
|
expect(response).to redirect_to(root_path)
|
292
292
|
|
@@ -294,7 +294,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
294
294
|
|
295
295
|
it "--(UPDATE ACTION) redirects to root path, does not set client or redirect url," do
|
296
296
|
sign_in_as_a_valid_and_confirmed_user
|
297
|
-
put user_registration_path, :id => @user.id, :user => {:password => "dogisdead", :current_password => 'password'}, :api_key => "invalid api key", redirect_url: "http://www.google.com" , current_app_id: "testappid"
|
297
|
+
put user_registration_path, params: {:id => @user.id, :user => {:password => "dogisdead", :current_password => 'password'}, :api_key => "invalid api key", redirect_url: "http://www.google.com" , current_app_id: "testappid"}
|
298
298
|
updated_user = assigns(:user)
|
299
299
|
user1 = User.where(:email => @user.email).first
|
300
300
|
expect(user1.valid_password?("dogisdead")).to eq(true)
|
@@ -309,7 +309,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
309
309
|
|
310
310
|
it "---CREATE redirects to default path --- " do
|
311
311
|
|
312
|
-
post user_registration_path, {user: attributes_for(:user), api_key: @ap_key, redirect_url: "http://www.yahoo.com", current_app_id: "testappid"}
|
312
|
+
post user_registration_path, params: {user: attributes_for(:user), api_key: @ap_key, redirect_url: "http://www.yahoo.com", current_app_id: "testappid"}
|
313
313
|
|
314
314
|
@user_just_created = assigns(:user)
|
315
315
|
expect(session[:client]).not_to be_nil
|
@@ -321,7 +321,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
321
321
|
|
322
322
|
sign_in_as_a_valid_and_confirmed_user
|
323
323
|
|
324
|
-
put user_registration_path, :id => @user.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, :api_key => @ap_key, redirect_url: "http://www.yahoo.com", current_app_id: "testappid"
|
324
|
+
put user_registration_path, params: {:id => @user.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, :api_key => @ap_key, redirect_url: "http://www.yahoo.com", current_app_id: "testappid"}
|
325
325
|
|
326
326
|
@user_just_updated = assigns(:user)
|
327
327
|
expect(session[:client]).not_to be_nil
|
@@ -336,7 +336,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
336
336
|
|
337
337
|
it " -- redirects in create action -- ",:problem_noww => true do
|
338
338
|
|
339
|
-
post user_registration_path, {user: attributes_for(:user_confirmed), api_key: @ap_key, redirect_url: "http://www.google.com", current_app_id: "testappid"}
|
339
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed), api_key: @ap_key, redirect_url: "http://www.google.com", current_app_id: "testappid"}
|
340
340
|
@user_just_created = assigns(:user)
|
341
341
|
|
342
342
|
|
@@ -350,7 +350,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
350
350
|
it "--- redirects in put action --- " do
|
351
351
|
|
352
352
|
sign_in_as_a_valid_and_confirmed_user
|
353
|
-
put user_registration_path, :id => @user.id, :user => {:password => "dogisdead", :current_password => 'password'}, :api_key => @ap_key, redirect_url: "http://www.google.com", current_app_id: "testappid"
|
353
|
+
put user_registration_path, params: {:id => @user.id, :user => {:password => "dogisdead", :current_password => 'password'}, :api_key => @ap_key, redirect_url: "http://www.google.com", current_app_id: "testappid"}
|
354
354
|
@user_just_updated = assigns(:user)
|
355
355
|
|
356
356
|
auth_token = @user_just_updated.authentication_token
|
@@ -388,7 +388,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
388
388
|
@u.client_authentication["testappid"] = "testestoken"
|
389
389
|
@u.versioned_update
|
390
390
|
@ap_key = @c.api_key
|
391
|
-
@headers = { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json"}
|
391
|
+
@headers = { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "HTTP_ACCEPT" => "application/json"}
|
392
392
|
|
393
393
|
## second user.
|
394
394
|
@u2 = User.new(attributes_for(:user_confirmed))
|
@@ -400,24 +400,30 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
400
400
|
|
401
401
|
context " -- fails without an api key --- " do
|
402
402
|
it " - READ - " do
|
403
|
-
get new_user_registration_path,nil
|
403
|
+
get new_user_registration_path,params: nil, headers: @headers
|
404
404
|
expect(response.code).to eq("401")
|
405
405
|
end
|
406
406
|
|
407
|
-
it " - CREATE - " do
|
408
|
-
|
407
|
+
it " - CREATE - ", :json_create => true do
|
408
|
+
|
409
|
+
## today we get auth tests passing.
|
410
|
+
## integrated with local.
|
411
|
+
## with ui, and sign up.
|
412
|
+
## then we go for organization, etc.
|
413
|
+
|
414
|
+
post user_registration_path, params: {user: attributes_for(:user)}.to_json, headers: @headers
|
409
415
|
expect(response.code).to eq("401")
|
410
416
|
end
|
411
417
|
|
412
418
|
it " - UPDATE - " do
|
413
419
|
a = {:id => @u.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}}
|
414
|
-
put user_registration_path, a.to_json
|
420
|
+
put user_registration_path, params: a.to_json,headers: @headers
|
415
421
|
expect(response.code).to eq("401")
|
416
422
|
end
|
417
423
|
|
418
424
|
it " - DESTROY - " do
|
419
425
|
a = {:id => @u.id}
|
420
|
-
delete user_registration_path, a.to_json, @headers
|
426
|
+
delete user_registration_path, params: a.to_json, headers: @headers
|
421
427
|
expect(response.code).to eq("401")
|
422
428
|
end
|
423
429
|
|
@@ -425,24 +431,24 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
425
431
|
|
426
432
|
context " -- invalid api key -- " do
|
427
433
|
it " - READ - " do
|
428
|
-
get new_user_registration_path,{api_key: "doggy"}
|
434
|
+
get new_user_registration_path,params: {api_key: "doggy"},headers: @headers
|
429
435
|
expect(response.code).to eq("401")
|
430
436
|
end
|
431
437
|
|
432
438
|
it " - CREATE - " do
|
433
|
-
post user_registration_path, {user: attributes_for(:user), api_key: "doggy"}.to_json, @headers
|
439
|
+
post user_registration_path, params: {user: attributes_for(:user), api_key: "doggy"}.to_json, headers: @headers
|
434
440
|
expect(response.code).to eq("401")
|
435
441
|
end
|
436
442
|
|
437
443
|
it " - UPDATE - " do
|
438
444
|
a = {:id => @u.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, api_key: "doggy"}
|
439
|
-
put user_registration_path, a.to_json
|
445
|
+
put user_registration_path, params: a.to_json, headers: @headers
|
440
446
|
expect(response.code).to eq("401")
|
441
447
|
end
|
442
448
|
|
443
449
|
it " - DESTROY - " do
|
444
450
|
a = {:id => @u.id, api_key: "dogy"}
|
445
|
-
delete user_registration_path, a.to_json, @headers
|
451
|
+
delete user_registration_path, params: a.to_json, headers: @headers
|
446
452
|
expect(response.code).to eq("401")
|
447
453
|
end
|
448
454
|
|
@@ -454,7 +460,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
454
460
|
context " -- valid api key -- " do
|
455
461
|
|
456
462
|
it " -- CREATE UNCONFIRMED EMAIL ACCOUNT - does not return auth_token and es ", :now => true do
|
457
|
-
post user_registration_path, {user: attributes_for(:user),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
463
|
+
post user_registration_path, params: {user: attributes_for(:user),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
458
464
|
@user_created = assigns(:user)
|
459
465
|
|
460
466
|
user_json_hash = JSON.parse(response.body)
|
@@ -462,7 +468,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
462
468
|
end
|
463
469
|
|
464
470
|
it " -- CREATE CONFIRMED EMAIL ACCOUNT - returns the auth token and es -- ", :nowie => true do
|
465
|
-
post user_registration_path, {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
471
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
466
472
|
@user_created = assigns(:user)
|
467
473
|
|
468
474
|
user_json_hash = JSON.parse(response.body)
|
@@ -474,7 +480,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
474
480
|
|
475
481
|
it " -- CREATE UNCONFIRMED MOBILE ACCOUNT - does not return auth_token and es ", :now => true do
|
476
482
|
|
477
|
-
post user_registration_path, {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
483
|
+
post user_registration_path, params: {user: attributes_for(:user_mobile),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
478
484
|
@user_created = assigns(:user)
|
479
485
|
|
480
486
|
user_json_hash = JSON.parse(response.body)
|
@@ -500,7 +506,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
500
506
|
|
501
507
|
it " -- json request without android header passes, because it simply returns true from the check_recaptcha def -- " do
|
502
508
|
|
503
|
-
post user_registration_path, {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
509
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
504
510
|
resp = JSON.parse(response.body)
|
505
511
|
expect(resp.keys).to match_array(["authentication_token","es"])
|
506
512
|
|
@@ -511,7 +517,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
511
517
|
it " -- json request with android header will fail, because verify recaptcha fails. " do
|
512
518
|
@headers["OS-ANDROID"] = true
|
513
519
|
|
514
|
-
post user_registration_path, {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, @headers
|
520
|
+
post user_registration_path, params: {user: attributes_for(:user_confirmed),:api_key => @ap_key, :current_app_id => "testappid"}.to_json, headers: @headers
|
515
521
|
#puts response.body.to_s
|
516
522
|
resp = JSON.parse(response.body)
|
517
523
|
expect(resp["errors"]).to eq("recaptcha validation error")
|
@@ -532,7 +538,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
532
538
|
puts "the u2 authentication token is:"
|
533
539
|
puts @u2.authentication_token.to_s
|
534
540
|
|
535
|
-
put user_registration_path, a.to_json
|
541
|
+
put user_registration_path, params: a.to_json,headers: @headers.merge({"X-User-Token" => @u2.authentication_token, "X-User-Es" => "testestoken1", "X-User-Aid" => "testappid"})
|
536
542
|
@user_updated = assigns(:user)
|
537
543
|
|
538
544
|
|
@@ -544,7 +550,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
544
550
|
it " -- doesnt respect redirects --- " do
|
545
551
|
a = {:id => @u.id, :user => {:email => "rihanna@gmail.com", :current_password => 'password'}, api_key: @ap_key, redirect_url: "http://www.google.com", :current_app_id => "testappid"}
|
546
552
|
|
547
|
-
put user_registration_path, a.to_json
|
553
|
+
put user_registration_path, params: a.to_json, headers: @headers.merge({"X-User-Token" => @u.authentication_token, "X-User-Es" => @u.client_authentication["testappid"], "X-User-Aid" => "testappid"})
|
548
554
|
@user_updated = assigns(:user)
|
549
555
|
|
550
556
|
expect(response.code).to eq("200")
|
@@ -560,7 +566,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
560
566
|
|
561
567
|
|
562
568
|
a = {:id => @u.id, :api_key => @ap_key, :current_app_id => "testappid"}
|
563
|
-
delete user_registration_path(format: :json), a.to_json, @headers.merge({"X-User-Token" => @u.authentication_token, "X-User-Es" => @u.client_authentication["testappid"], "X-User-Aid" => "testappid"})
|
569
|
+
delete user_registration_path(format: :json), params: a.to_json, headers: @headers.merge({"X-User-Token" => @u.authentication_token, "X-User-Es" => @u.client_authentication["testappid"], "X-User-Aid" => "testappid"})
|
564
570
|
expect(response.code).to eq("200")
|
565
571
|
|
566
572
|
end
|
@@ -602,7 +608,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
602
608
|
|
603
609
|
c1_user_attribs = attributes_for(:user_confirmed)
|
604
610
|
|
605
|
-
post user_registration_path, {user: c1_user_attribs, api_key: @ap_key1, current_app_id: @c1.app_ids[0]}
|
611
|
+
post user_registration_path, params: {user: c1_user_attribs, api_key: @ap_key1, current_app_id: @c1.app_ids[0]}
|
606
612
|
|
607
613
|
@user_created_by_first_client = User.where(:email => c1_user_attribs[:email]).first
|
608
614
|
|
@@ -620,7 +626,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
620
626
|
|
621
627
|
##now post to the user_registration_path using each of these seperately.
|
622
628
|
c2_user_attribs = attributes_for(:user_confirmed)
|
623
|
-
post user_registration_path, {user: c2_user_attribs, api_key: @ap_key2, current_app_id: @c2.app_ids[0]}
|
629
|
+
post user_registration_path, params: {user: c2_user_attribs, api_key: @ap_key2, current_app_id: @c2.app_ids[0]}
|
624
630
|
@user_created_by_second_client = User.where(:email => c2_user_attribs[:email]).first
|
625
631
|
expect(@user_created_by_second_client.client_authentication).not_to be_nil
|
626
632
|
expect(@user_created_by_second_client.client_authentication).not_to be_empty
|
@@ -654,7 +660,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
654
660
|
|
655
661
|
it " -- creates user with one app id. -- " do
|
656
662
|
c1_user_attribs = attributes_for(:user_confirmed)
|
657
|
-
post user_registration_path, {user: c1_user_attribs, api_key: @ap_key1, current_app_id: @c1.app_ids[0]}
|
663
|
+
post user_registration_path, params: {user: c1_user_attribs, api_key: @ap_key1, current_app_id: @c1.app_ids[0]}
|
658
664
|
##expect this users client_authentication to contain the first app id.
|
659
665
|
@usr = assigns(:user)
|
660
666
|
expect(@usr.client_authentication.keys.size).to eql(1)
|
@@ -663,7 +669,7 @@ RSpec.describe "Registration requests", :registration => true,:authentication =>
|
|
663
669
|
|
664
670
|
it " -- creates user with another app id -- " do
|
665
671
|
c1_user_attribs = attributes_for(:user_confirmed)
|
666
|
-
post user_registration_path, {user: c1_user_attribs, api_key: @ap_key1, current_app_id: @c1.app_ids[1]}
|
672
|
+
post user_registration_path, params: {user: c1_user_attribs, api_key: @ap_key1, current_app_id: @c1.app_ids[1]}
|
667
673
|
@usr = assigns(:user)
|
668
674
|
expect(@usr.client_authentication.keys.size).to eql(1)
|
669
675
|
expect(@usr.client_authentication["testappid2"]).not_to be_nil
|