Sha256: e469edfd01b6069435b78c853ce7a2b02a378a5679b4778e4c2c3563a464ff24
Contents?: true
Size: 1.45 KB
Versions: 10
Compression:
Stored size: 1.45 KB
Contents
require 'spec_helper' describe Auth0::Api::V2::Tickets do attr_reader :client, :test_user before(:all) do @client = Auth0Client.new(v2_creds) test_user_name = "#{entity_suffix}-username" VCR.use_cassette('Auth0_Api_V2_Tickets/create_test_user') do @test_user = client.create_user( test_user_name, 'email' => "#{entity_suffix}-#{test_user_name}@auth0.com", 'password' => Faker::Internet.password, 'connection' => Auth0::Api::AuthenticationEndpoints::UP_AUTH ) end end after(:all) do VCR.use_cassette('Auth0_Api_V2_Tickets/delete_test_user') do client.delete_user(test_user['user_id']) end end describe '.post_email_verification', vcr: true do it 'should create an email verification ticket' do expect( client.post_email_verification( test_user['user_id'], result_url: 'https://auth0.com/callback' ) ).to include('ticket') end it 'should raise an error if the user id is empty' do expect do client.post_email_verification( '' ) end.to raise_error Auth0::InvalidParameter end end describe '.post_password_change', vcr: true do it 'should create a password change ticket' do expect( client.post_password_change( new_password: 'secret', user_id: test_user['user_id'], result_url: 'https://auth0.com/callback' ) ).to include('ticket') end end end
Version data entries
10 entries across 10 versions & 1 rubygems