From 113f8be5217b33daaa6e45d70982530a95859a3e Mon Sep 17 00:00:00 2001 From: Aaron L Date: Tue, 23 Aug 2016 23:28:49 -0700 Subject: [PATCH] Correct tests --- bdb/drivers/mock.go | 10 +++++----- text_helpers_test.go | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bdb/drivers/mock.go b/bdb/drivers/mock.go index c10ff95..b4c1943 100644 --- a/bdb/drivers/mock.go +++ b/bdb/drivers/mock.go @@ -59,15 +59,15 @@ func (m *MockDriver) Columns(tableName string) ([]bdb.Column, error) { func (m *MockDriver) ForeignKeyInfo(tableName string) ([]bdb.ForeignKey, error) { return map[string][]bdb.ForeignKey{ "jets": { - {Name: "jets_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, - {Name: "jets_airport_id_fk", Column: "airport_id", ForeignTable: "airports", ForeignColumn: "id"}, + {Table: "jets", Name: "jets_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, + {Table: "jets", Name: "jets_airport_id_fk", Column: "airport_id", ForeignTable: "airports", ForeignColumn: "id"}, }, "licenses": { - {Name: "licenses_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, + {Table: "licenses", Name: "licenses_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, }, "pilot_languages": { - {Name: "pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, - {Name: "jet_id_fk", Column: "language_id", ForeignTable: "languages", ForeignColumn: "id"}, + {Table: "pilot_languages", Name: "pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, + {Table: "pilot_languages", Name: "jet_id_fk", Column: "language_id", ForeignTable: "languages", ForeignColumn: "id"}, }, }[tableName], nil } diff --git a/text_helpers_test.go b/text_helpers_test.go index 3fbe655..aa574ad 100644 --- a/text_helpers_test.go +++ b/text_helpers_test.go @@ -59,6 +59,7 @@ func TestTextsFromOneToOneRelationship(t *testing.T) { expect := RelationshipToOneTexts{} expect.ForeignKey = bdb.ForeignKey{ + Table: "jets", Name: "none", Column: "id", Nullable: false,