Makes error store allow update if error only on get
This commit is contained in:
parent
169afed5c9
commit
2a3d789292
@ -21,7 +21,10 @@ func (e *errorStore) InsertAction(action *models.Action) (int, error) {
|
||||
}
|
||||
|
||||
func (e *errorStore) UpdateAction(action *models.Action) error {
|
||||
return e.error
|
||||
if e.errorOnInsert {
|
||||
return e.error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *errorStore) SelectPlans() ([]*models.Plan, error) {
|
||||
|
@ -31,6 +31,8 @@ func TestErrorActionMethods(t *testing.T) {
|
||||
replacementAction := &models.Action{}
|
||||
err = str.UpdateAction(replacementAction)
|
||||
assert.NotNil(err)
|
||||
err = str2.UpdateAction(replacementAction)
|
||||
assert.Nil(err)
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user