TestViewSubsetTemplate ensures TemplateTable is a subset of Template
(t *testing.T)
| 25 | |
| 26 | // TestViewSubsetTemplate ensures TemplateTable is a subset of Template |
| 27 | func TestViewSubsetTemplate(t *testing.T) { |
| 28 | t.Parallel() |
| 29 | table := reflect.TypeOf(database.TemplateTable{}) |
| 30 | joined := reflect.TypeOf(database.Template{}) |
| 31 | |
| 32 | tableFields := allFields(table) |
| 33 | joinedFields := allFields(joined) |
| 34 | if !assert.Subset(t, fieldNames(joinedFields), fieldNames(tableFields), "table is not subset") { |
| 35 | t.Log("Some fields were added to the Template Table without updating the 'template_with_names' view.") |
| 36 | t.Log("See migration 000138_join_users.up.sql to create the view.") |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // TestViewSubsetTemplateVersion ensures TemplateVersionTable is a subset TemplateVersion |
| 41 | func TestViewSubsetTemplateVersion(t *testing.T) { |
nothing calls this directly
no test coverage detected