Browse Source

fix test lefoovers

Umputun 5 years ago
parent
commit
d7fc131748
2 changed files with 2 additions and 1 deletions
  1. 1 1
      app/rss/notify.go
  2. 1 0
      app/rss/notify_test.go

+ 1 - 1
app/rss/notify.go

@@ -70,7 +70,7 @@ func (n *Notify) Go(ctx context.Context) <-chan Event {
 			}
 			event, err := n.feedEvent(feedData)
 			if lastGUID != event.guid && err == nil {
-				if lastGUID != "xyz" { // don't notify on initial change
+				if lastGUID != "" { // don't notify on initial change
 					log.Printf("[INFO] new event %s - %s", event.guid, event.Title)
 					ch <- event
 				} else {

+ 1 - 0
app/rss/notify_test.go

@@ -35,6 +35,7 @@ func TestNotify(t *testing.T) {
 	st := time.Now()
 	e := <-ch
 	t.Logf("%+v", e)
+	e.Text = ""
 	assert.Equal(t, Event{ChanTitle: "Радио-Т", Title: "Радио-Т 626",
 		Link: "https://radio-t.com/p/2018/12/01/podcast-626/", guid: "https://radio-t.com/p/2018/12/01//podcast-626/"}, e)
 	assert.True(t, time.Since(st) >= time.Millisecond*250)