Sha256: dfff84ed8c9d25b9208858da80a0d824154e2b7519b2d390a8af0043175cca08

Contents?: true

Size: 1.35 KB

Versions: 2

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'
describe Auth0::Api::V2::Tickets do
  attr_reader :client, :user

  before(:all) do
    @client = Auth0Client.new(v2_creds)
    username = Faker::Internet.user_name
    email = "#{entity_suffix}#{Faker::Internet.safe_email(username)}"
    password = Faker::Internet.password
    sleep 1
    @user = client.create_user(username,  'email' => email,
                                          'password' => password,
                                          'email_verified' => false,
                                          'connection' => Auth0::Api::AuthenticationEndpoints::UP_AUTH,
                                          'app_metadata' => {})
  end

  after(:all) do
    sleep 1
    client.delete_user(user['user_id'])
  end

  describe '.post_email_verification' do
    let(:email_verification) do
      sleep 1
      client.post_email_verification(user['user_id'], result_url: 'http://myapp.com/callback')
    end
    it do
      sleep 1
      expect(email_verification).to include('ticket')
    end
  end

  describe '.post_password_change' do
    let(:password_change) do
      sleep 1
      client.post_password_change(new_password: 'secret', user_id: user['user_id'],
                                  result_url: 'http://myapp.com/callback')
    end
    it do
      sleep 1
      expect(password_change).to include('ticket')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auth0-4.5.0 spec/integration/lib/auth0/api/v2/api_tickets_spec.rb
auth0-4.4.0 spec/integration/lib/auth0/api/v2/api_tickets_spec.rb