2021-12-20 00:32:16 +01:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"heckel.io/ntfy/util"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2021-12-20 03:01:49 +01:00
|
|
|
func TestCLI_Publish_Subscribe_Poll_Real_Server(t *testing.T) {
|
2021-12-20 00:32:16 +01:00
|
|
|
testMessage := util.RandomString(10)
|
|
|
|
|
|
|
|
app, _, _, _ := newTestApp()
|
|
|
|
require.Nil(t, app.Run([]string{"ntfy", "publish", "ntfytest", "ntfy unit test " + testMessage}))
|
|
|
|
|
|
|
|
app2, _, stdout, _ := newTestApp()
|
|
|
|
require.Nil(t, app2.Run([]string{"ntfy", "subscribe", "--poll", "ntfytest"}))
|
|
|
|
require.Contains(t, stdout.String(), testMessage)
|
|
|
|
}
|