2019-11-12 11:14:34 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package coinpayments_test
|
|
|
|
|
|
|
|
import (
|
2022-11-29 12:36:41 +00:00
|
|
|
"net/url"
|
2019-11-12 11:14:34 +00:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"storj.io/storj/satellite/payments/coinpayments"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetCheckoutURL(t *testing.T) {
|
|
|
|
expected := "example"
|
|
|
|
|
2022-11-29 12:36:41 +00:00
|
|
|
link := coinpayments.GetCheckoutURL(expected, "id")
|
2019-11-12 11:14:34 +00:00
|
|
|
|
2022-11-29 12:36:41 +00:00
|
|
|
u, err := url.Parse(link)
|
2019-11-12 11:14:34 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
2022-11-29 12:36:41 +00:00
|
|
|
assert.Equal(t, expected, u.Query().Get("key"))
|
2019-11-12 11:14:34 +00:00
|
|
|
}
|