aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Patrick <pmarschik@users.noreply.github.com>2018-09-20 03:19:24 +0200
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-09-19 18:19:24 -0700
commit2538eea1776e1d03d33465ad2001512caca93937 (patch)
tree021c417d5f31606fe50d7945872c4cda6cdc2060 /tests
parent1d335390c2ac7c0feeb94fce89eefdae9a1e7c17 (diff)
Add the possibility to override default user agent for each feed
Diffstat (limited to 'tests')
-rw-r--r--tests/feed_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/feed_test.go b/tests/feed_test.go
index c930826..eba68ba 100644
--- a/tests/feed_test.go
+++ b/tests/feed_test.go
@@ -195,6 +195,31 @@ func TestUpdateFeedRewriteRules(t *testing.T) {
}
}
+func TestUpdateFeedUserAgent(t *testing.T) {
+ client := createClient(t)
+ feed, _ := createFeed(t, client)
+
+ userAgent := "test"
+ updatedFeed, err := client.UpdateFeed(feed.ID, &miniflux.FeedModification{UserAgent: &userAgent})
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if updatedFeed.UserAgent != userAgent {
+ t.Fatalf(`Wrong UserAgent value, got "%v" instead of "%v"`, updatedFeed.UserAgent, userAgent)
+ }
+
+ userAgent = ""
+ updatedFeed, err = client.UpdateFeed(feed.ID, &miniflux.FeedModification{UserAgent: &userAgent})
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if updatedFeed.UserAgent != userAgent {
+ t.Fatalf(`Wrong UserAgent value, got "%v" instead of "%v"`, updatedFeed.UserAgent, userAgent)
+ }
+}
+
func TestUpdateFeedUsername(t *testing.T) {
client := createClient(t)
feed, _ := createFeed(t, client)