@@ -62,15 +62,15 @@ type EntryV2 struct {
6262 Status string `db:"status"`
6363}
6464
65- func insertSpecV2 (dbFilePath , newSpec string ) (* EntryV2 , error ) {
65+ func insertSpecV2 (dbFilePath , newSpec , state string ) (* EntryV2 , error ) {
6666
6767 db , err := sql .Open ("sqlite3" , dbFilePath )
6868 if err != nil {
6969 return nil , err
7070 }
7171 defer db .Close ()
7272
73- q := fmt .Sprintf ("INSERT INTO openapi_schemas(schema_version,schema_format,schema_content,status) VALUES ('1', 'yaml', '%s', 'new ')" , newSpec )
73+ q := fmt .Sprintf ("INSERT INTO openapi_schemas(schema_version,schema_format,schema_content,status) VALUES ('1', 'yaml', '%s', '%s ')" , newSpec , state )
7474 _ , err = db .Exec (q )
7575 if err != nil {
7676 return nil , err
@@ -141,7 +141,7 @@ func TestLoadBasicV2(t *testing.T) {
141141 var lock sync.RWMutex
142142
143143 // create DB entry with spec and status = 'new'
144- entry , err := insertSpecV2 (currentDBPath , testYamlSpecification )
144+ entry , err := insertSpecV2 (currentDBPath , testYamlSpecification , "new" )
145145 if err != nil {
146146 t .Fatal (err )
147147 }
@@ -250,7 +250,7 @@ func TestUpdaterBasicV2(t *testing.T) {
250250 }
251251
252252 // create DB entry with spec and status = 'new'
253- entry , err := insertSpecV2 (currentDBPath , testYamlSpecification )
253+ entry , err := insertSpecV2 (currentDBPath , testYamlSpecification , "new" )
254254 if err != nil {
255255 t .Fatal (err )
256256 }
@@ -1096,7 +1096,7 @@ func TestUpdaterFromV1DBToV2(t *testing.T) {
10961096
10971097 // prepare spec with status = 'new'
10981098 // create DB entry with spec and status = 'new'
1099- entry , err := insertSpecV2 (currentDBPath , testYamlSpecification )
1099+ entry , err := insertSpecV2 (currentDBPath , testYamlSpecification , "new" )
11001100 if err != nil {
11011101 t .Fatal (err )
11021102 }
0 commit comments