1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 20:58:39 -04:00

Split securities into models

This commit is contained in:
2017-12-03 06:38:22 -05:00
parent 3f4d6d15a1
commit f72c86ef58
17 changed files with 170 additions and 151 deletions

View File

@ -2,12 +2,13 @@ package handlers_test
import (
"github.com/aclindsa/moneygo/internal/handlers"
"github.com/aclindsa/moneygo/internal/models"
"io/ioutil"
"testing"
)
func TestSecurityTemplates(t *testing.T) {
var sl handlers.SecurityList
var sl models.SecurityList
response, err := server.Client().Get(server.URL + "/v1/securitytemplates/?search=USD&type=currency")
if err != nil {
t.Fatal(err)
@ -30,7 +31,7 @@ func TestSecurityTemplates(t *testing.T) {
num_usd := 0
if sl.Securities != nil {
for _, s := range *sl.Securities {
if s.Type != handlers.Currency {
if s.Type != models.Currency {
t.Fatalf("Requested Currency-only security templates, received a non-Currency template for %s", s.Name)
}
@ -46,7 +47,7 @@ func TestSecurityTemplates(t *testing.T) {
}
func TestSecurityTemplateLimit(t *testing.T) {
var sl handlers.SecurityList
var sl models.SecurityList
response, err := server.Client().Get(server.URL + "/v1/securitytemplates/?search=e&limit=5")
if err != nil {
t.Fatal(err)