Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Jun 17, 2019
1 parent fd126c7 commit 948246c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions libraries/shared/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ var _ = Describe("Repository", func() {
})

AfterEach(func() {
//test_config.CleanCheckedHeadersTable(db, getExpectedColumnNames())
test_config.CleanCheckedHeadersTable(db, getExpectedColumnNames())
})

It("only treats headers as checked if the event specific logs have been checked", func() {
Expand Down Expand Up @@ -246,8 +246,8 @@ var _ = Describe("Repository", func() {
})
})

Describe("CreateCustomColumnNamesSQL", func() {
Describe("for MissingHeaders", func() {
Describe("CreateHeaderCheckedPredicateSQL", func() {
Describe("for headers that haven't been checked for logs", func() {
It("generates a correct SQL string for one column", func() {
columns := []string{"columnA"}
expected := " (columnA=0)"
Expand All @@ -269,13 +269,7 @@ var _ = Describe("Repository", func() {
})
})

Describe("RecheckHeadersCustomColumnNames", func() {
It("defaults to FALSE when there are no columns", func() {
expected := "FALSE"
actual := shared.CreateHeaderCheckedPredicateSQL([]string{}, constants.HeaderRecheck)
Expect(actual).To(Equal(expected))
})

Describe("for headers that are being rechecked for logs", func() {
It("generates a correct SQL string for rechecking headers for one column", func() {
columns := []string{"columnA"}
expected := fmt.Sprintf(" (columnA<%s)", constants.RecheckHeaderCap)
Expand All @@ -289,8 +283,13 @@ var _ = Describe("Repository", func() {
actual := shared.CreateHeaderCheckedPredicateSQL(columns, constants.HeaderRecheck)
Expect(actual).To(Equal(expected))
})
})

It("defaults to FALSE when there are no columns", func() {
expected := "FALSE"
actual := shared.CreateHeaderCheckedPredicateSQL([]string{}, constants.HeaderRecheck)
Expect(actual).To(Equal(expected))
})
})
})
})

Expand Down

0 comments on commit 948246c

Please sign in to comment.