From 79b3397c17ec0ac53b2ec3e33a5bcd800397baae Mon Sep 17 00:00:00 2001 From: eal Date: Mon, 11 Dec 2017 18:41:03 +0200 Subject: Fix tests. --- test/web/mastodon_api/mastodon_api_controller_test.exs | 4 ++-- test/web/twitter_api/twitter_api_test.exs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index fc0010569..8bfad5265 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -145,7 +145,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> assign(:user, user) |> get("/api/v1/notifications") - expected_response = "hi @#{user.nickname}" + expected_response = "hi @#{user.nickname}" assert [%{"status" => %{"content" => response}} | _rest] = json_response(conn, 200) assert response == expected_response end @@ -161,7 +161,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> assign(:user, user) |> get("/api/v1/notifications/#{notification.id}") - expected_response = "hi @#{user.nickname}" + expected_response = "hi @#{user.nickname}" assert %{"status" => %{"content" => response}} = json_response(conn, 200) assert response == expected_response end diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index 96552f97e..823ba3913 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -34,7 +34,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input) - assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #2hu #epic #phantasmagoric
image.jpg" + assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #2hu #epic #phantasmagoric
image.jpg" assert get_in(activity.data, ["object", "type"]) == "Note" assert get_in(activity.data, ["object", "actor"]) == user.ap_id assert get_in(activity.data, ["actor"]) == user.ap_id @@ -291,7 +291,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"}) mentions = Pleroma.Formatter.parse_mentions(text) - expected_text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme" + expected_text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme" assert Utils.add_user_links(text, mentions) == expected_text end -- cgit v1.2.3 From 9223038319f0281f104fb9bb85c0cb8f6e52984a Mon Sep 17 00:00:00 2001 From: eal Date: Mon, 11 Dec 2017 21:01:36 +0200 Subject: Fix some more tests. --- test/web/mastodon_api/status_view_test.exs | 4 +++- test/web/twitter_api/views/user_view_test.exs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index 93c0b7236..0d396f3b8 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -56,7 +56,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do test "contains mentions" do incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml") - user = insert(:user, %{ap_id: "https://pleroma.soykaf.com/users/lain"}) + # a user with this ap id might be in the cache. + recipient = "https://pleroma.soykaf.com/users/lain" + user = User.get_cached_by_ap_id(recipient) || insert(:user, %{ap_id: recipient}) {:ok, [activity]} = OStatus.handle_incoming(incoming) diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 18a19ef70..753e41d20 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -30,8 +30,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do User.follow(follower, user) User.follow(second_follower, user) User.follow(user, follower) - - user = Repo.get!(User, user.id) + {:ok, user} = User.update_follower_count(user) + Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) image = "https://placehold.it/48x48" -- cgit v1.2.3 From 1969773fb4a8a6b2cf4354cd4e879bfe6c08dca6 Mon Sep 17 00:00:00 2001 From: eal Date: Mon, 18 Dec 2017 16:23:04 +0200 Subject: Fix follower/following lists. Add tests. --- .../twitter_api/twitter_api_controller_test.exs | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 90d0fa654..39f1cdd4c 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -518,7 +518,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do end describe "GET /api/statuses/friends" do - test "it returns a user's friends", %{conn: conn} do + test "it returns the logged in user's friends", %{conn: conn} do user = insert(:user) followed_one = insert(:user) followed_two = insert(:user) @@ -533,6 +533,36 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do assert MapSet.equal?(MapSet.new(json_response(conn, 200)), MapSet.new(UserView.render("index.json", %{users: [followed_one, followed_two], for: user}))) end + + test "it returns a given user's friends with user_id", %{conn: conn} do + user = insert(:user) + followed_one = insert(:user) + followed_two = insert(:user) + not_followed = insert(:user) + + {:ok, user} = User.follow(user, followed_one) + {:ok, user} = User.follow(user, followed_two) + + conn = conn + |> get("/api/statuses/friends", %{"user_id" => user.id}) + + assert MapSet.equal?(MapSet.new(json_response(conn, 200)), MapSet.new(UserView.render("index.json", %{users: [followed_one, followed_two], for: user}))) + end + + test "it returns a given user's friends with screen_name", %{conn: conn} do + user = insert(:user) + followed_one = insert(:user) + followed_two = insert(:user) + not_followed = insert(:user) + + {:ok, user} = User.follow(user, followed_one) + {:ok, user} = User.follow(user, followed_two) + + conn = conn + |> get("/api/statuses/friends", %{"screen_name" => user.nickname}) + + assert MapSet.equal?(MapSet.new(json_response(conn, 200)), MapSet.new(UserView.render("index.json", %{users: [followed_one, followed_two], for: user}))) + end end describe "GET /friends/ids" do -- cgit v1.2.3 From 47887ac8489d929f6c948814a8bacd14fc579ab9 Mon Sep 17 00:00:00 2001 From: Lain Iwakura Date: Mon, 18 Dec 2017 16:56:03 +0100 Subject: MastoAPI: Fix always-sensitive bugs. --- test/web/mastodon_api/mastodon_api_controller_test.exs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 8bfad5265..80e15f35e 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -35,7 +35,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do {:ok, [_activity]} = OStatus.fetch_activity_from_url("https://shitposter.club/notice/2827873") conn = conn - |> get("/api/v1/timelines/public") + |> get("/api/v1/timelines/public", %{"local" => "False"}) assert length(json_response(conn, 200)) == 2 @@ -50,9 +50,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do conn = conn |> assign(:user, user) - |> post("/api/v1/statuses", %{"status" => "cofe", "spoiler_text" => "2hu"}) + |> post("/api/v1/statuses", %{"status" => "cofe", "spoiler_text" => "2hu", "sensitive" => "false"}) - assert %{"content" => "cofe", "id" => id, "spoiler_text" => "2hu"} = json_response(conn, 200) + assert %{"content" => "cofe", "id" => id, "spoiler_text" => "2hu", "sensitive" => false} = json_response(conn, 200) assert Repo.get(Activity, id) end -- cgit v1.2.3 From f1f79c0dca9198e2a427f988b60e4222f8afda57 Mon Sep 17 00:00:00 2001 From: Lain Iwakura Date: Tue, 19 Dec 2017 16:15:07 +0100 Subject: Fix timelines in subway tooter. --- test/web/mastodon_api/mastodon_api_controller_test.exs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 80e15f35e..79ad671d9 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -43,6 +43,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> get("/api/v1/timelines/public", %{"local" => "True"}) assert [%{"content" => "test"}] = json_response(conn, 200) + + conn = build_conn() + |> get("/api/v1/timelines/public", %{"local" => "1"}) + + assert [%{"content" => "test"}] = json_response(conn, 200) end test "posting a status", %{conn: conn} do -- cgit v1.2.3 From 6e1cb86166d82a4ac4e5fb2ecf8955b18a7ab466 Mon Sep 17 00:00:00 2001 From: eal Date: Sun, 14 Jan 2018 08:28:35 +0200 Subject: Fix instance test. --- test/web/mastodon_api/mastodon_api_controller_test.exs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 79ad671d9..93b29dfae 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -586,11 +586,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do {:ok, _} = TwitterAPI.create_status(user, %{"status" => "cofe"}) + Pleroma.Stats.update_stats() + conn = conn |> get("/api/v1/instance") assert result = json_response(conn, 200) assert result["stats"]["user_count"] == 2 + assert result["stats"]["status_count"] == 1 end end -- cgit v1.2.3 From 14b086eec22486d1efc8248f5f157696e7621e5b Mon Sep 17 00:00:00 2001 From: eal Date: Mon, 15 Jan 2018 22:18:17 +0200 Subject: Add a default profile picture and banner. This removes the placehold.it dependency. --- test/web/mastodon_api/account_view_test.exs | 8 ++++---- test/web/ostatus/user_representer_test.exs | 1 + test/web/twitter_api/views/user_view_test.exs | 23 +++++++++++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index eccfe0b36..061fc2693 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -19,10 +19,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do statuses_count: 5, note: user.bio, url: user.ap_id, - avatar: "https://placehold.it/48x48", - avatar_static: "https://placehold.it/48x48", - header: "https://placehold.it/700x335", - header_static: "https://placehold.it/700x335", + avatar: "http://localhost:4001/static/avi.png", + avatar_static: "http://localhost:4001/static/avi.png", + header: "http://localhost:4001/static/banner.png", + header_static: "http://localhost:4001/static/banner.png", source: %{ note: "", privacy: "public", diff --git a/test/web/ostatus/user_representer_test.exs b/test/web/ostatus/user_representer_test.exs index d5d70f5c6..b22420379 100644 --- a/test/web/ostatus/user_representer_test.exs +++ b/test/web/ostatus/user_representer_test.exs @@ -21,6 +21,7 @@ defmodule Pleroma.Web.OStatus.UserRepresenterTest do #{user.bio} #{user.nickname} + """ assert clean(res) == clean(expected) diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 753e41d20..3f84e4116 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -33,7 +33,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do {:ok, user} = User.update_follower_count(user) Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) - image = "https://placehold.it/48x48" + image = "http://localhost:4001/static/avi.png" + banner = "http://localhost:4001/static/banner.png" represented = %{ "id" => user.id, @@ -54,7 +55,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "statusnet_blocking" => false, "rights" => %{}, "statusnet_profile_url" => user.ap_id, - "cover_photo" => nil, + "cover_photo" => banner, "background_image" => nil } @@ -64,7 +65,9 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do test "A user for a given other follower", %{user: user} do {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]}) {:ok, user} = User.update_follower_count(user) - image = "https://placehold.it/48x48" + image = "http://localhost:4001/static/avi.png" + banner = "http://localhost:4001/static/banner.png" + represented = %{ "id" => user.id, "name" => user.name, @@ -84,7 +87,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "statusnet_blocking" => false, "rights" => %{}, "statusnet_profile_url" => user.ap_id, - "cover_photo" => nil, + "cover_photo" => banner, "background_image" => nil } @@ -95,7 +98,9 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do follower = insert(:user) {:ok, follower} = User.follow(follower, user) {:ok, user} = User.update_follower_count(user) - image = "https://placehold.it/48x48" + image = "http://localhost:4001/static/avi.png" + banner = "http://localhost:4001/static/banner.png" + represented = %{ "id" => follower.id, "name" => follower.name, @@ -115,7 +120,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "statusnet_blocking" => false, "rights" => %{}, "statusnet_profile_url" => follower.ap_id, - "cover_photo" => nil, + "cover_photo" => banner, "background_image" => nil } @@ -126,7 +131,9 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do user = insert(:user) blocker = insert(:user) User.block(blocker, user) - image = "https://placehold.it/48x48" + image = "http://localhost:4001/static/avi.png" + banner = "http://localhost:4001/static/banner.png" + represented = %{ "id" => user.id, "name" => user.name, @@ -146,7 +153,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "statusnet_blocking" => true, "rights" => %{}, "statusnet_profile_url" => user.ap_id, - "cover_photo" => nil, + "cover_photo" => banner, "background_image" => nil } -- cgit v1.2.3 From b3e7d7ae6d4ab4b871ecf18706461945fd148a1b Mon Sep 17 00:00:00 2001 From: eal Date: Tue, 16 Jan 2018 15:31:03 +0200 Subject: Fetch external profile in the background. --- test/web/twitter_api/twitter_api_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index 823ba3913..ac62880d5 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -404,7 +404,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"] # Also fetches the feed. - assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status") + # assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status") end end end -- cgit v1.2.3 From 1bb3ba02f398ff5ab94a8ddcc038db20b6474c0e Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 30 Jan 2018 12:17:01 +0100 Subject: Fix specs. --- test/web/ostatus/feed_representer_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/web/ostatus/feed_representer_test.exs b/test/web/ostatus/feed_representer_test.exs index df5a964e2..e10936366 100644 --- a/test/web/ostatus/feed_representer_test.exs +++ b/test/web/ostatus/feed_representer_test.exs @@ -26,6 +26,7 @@ defmodule Pleroma.Web.OStatus.FeedRepresenterTest do #{OStatus.feed_path(user)} #{user.nickname}'s timeline #{most_recent_update} + #{User.avatar_url(user)} -- cgit v1.2.3 From 450109460674d914171bd1a1516a2c5faf355a7c Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 30 Jan 2018 12:20:14 +0100 Subject: Make specs less breaky. --- test/notification_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/notification_test.exs b/test/notification_test.exs index eee1c9fa3..0a4462241 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -14,9 +14,9 @@ defmodule Pleroma.NotificationTest do {:ok, [notification, other_notification]} = Notification.create_notifications(activity) - assert notification.user_id == other_user.id + notified_ids = Enum.sort([notification.user_id, other_notification.user_id]) + assert notified_ids == [other_user.id, third_user.id] assert notification.activity_id == activity.id - assert other_notification.user_id == third_user.id assert other_notification.activity_id == activity.id end end -- cgit v1.2.3 From ab83e0de6d389428cec11fe94280d675a38f00d0 Mon Sep 17 00:00:00 2001 From: eal Date: Thu, 1 Feb 2018 21:41:19 +0200 Subject: TwitterAPI: Add is_local to user view. --- test/web/twitter_api/views/user_view_test.exs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 3f84e4116..e68230a86 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -56,7 +56,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "rights" => %{}, "statusnet_profile_url" => user.ap_id, "cover_photo" => banner, - "background_image" => nil + "background_image" => nil, + "is_local" => true } assert represented == UserView.render("show.json", %{user: user}) @@ -88,7 +89,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "rights" => %{}, "statusnet_profile_url" => user.ap_id, "cover_photo" => banner, - "background_image" => nil + "background_image" => nil, + "is_local" => true } assert represented == UserView.render("show.json", %{user: user, for: follower}) @@ -121,7 +123,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "rights" => %{}, "statusnet_profile_url" => follower.ap_id, "cover_photo" => banner, - "background_image" => nil + "background_image" => nil, + "is_local" => true } assert represented == UserView.render("show.json", %{user: follower, for: user}) @@ -154,7 +157,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "rights" => %{}, "statusnet_profile_url" => user.ap_id, "cover_photo" => banner, - "background_image" => nil + "background_image" => nil, + "is_local" => true } blocker = Repo.get(User, blocker.id) -- cgit v1.2.3 From 29be70c0082ea09f03896c7e52e2b8a9cdbea641 Mon Sep 17 00:00:00 2001 From: eal Date: Fri, 2 Feb 2018 00:00:48 +0200 Subject: Add remote following of local profiles. --- test/web/ostatus/ostatus_test.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs index de01612b3..b27f8cb55 100644 --- a/test/web/ostatus/ostatus_test.exs +++ b/test/web/ostatus/ostatus_test.exs @@ -302,7 +302,8 @@ defmodule Pleroma.Web.OStatusTest do "host" => "social.heldscal.la", "fqn" => user, "bio" => "cofe", - "avatar" => %{"type" => "Image", "url" => [%{"href" => "https://social.heldscal.la/avatar/29191-original-20170421154949.jpeg", "mediaType" => "image/jpeg", "type" => "Link"}]} + "avatar" => %{"type" => "Image", "url" => [%{"href" => "https://social.heldscal.la/avatar/29191-original-20170421154949.jpeg", "mediaType" => "image/jpeg", "type" => "Link"}]}, + "subscribe_address" => "https://social.heldscal.la/main/ostatussub?profile={uri}" } assert data == expected end @@ -325,7 +326,8 @@ defmodule Pleroma.Web.OStatusTest do "host" => "social.heldscal.la", "fqn" => user, "bio" => "cofe", - "avatar" => %{"type" => "Image", "url" => [%{"href" => "https://social.heldscal.la/avatar/29191-original-20170421154949.jpeg", "mediaType" => "image/jpeg", "type" => "Link"}]} + "avatar" => %{"type" => "Image", "url" => [%{"href" => "https://social.heldscal.la/avatar/29191-original-20170421154949.jpeg", "mediaType" => "image/jpeg", "type" => "Link"}]}, + "subscribe_address" => "https://social.heldscal.la/main/ostatussub?profile={uri}" } assert data == expected end -- cgit v1.2.3 From ea6d1b2b172d88b6ea47ab044813d39b053534b2 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 3 Feb 2018 20:43:14 +0900 Subject: move avi.png & banner.png from /priv/static/static to /priv/static/images --- test/web/mastodon_api/account_view_test.exs | 8 ++++---- test/web/twitter_api/views/user_view_test.exs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index 061fc2693..5eefa61e1 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -19,10 +19,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do statuses_count: 5, note: user.bio, url: user.ap_id, - avatar: "http://localhost:4001/static/avi.png", - avatar_static: "http://localhost:4001/static/avi.png", - header: "http://localhost:4001/static/banner.png", - header_static: "http://localhost:4001/static/banner.png", + avatar: "http://localhost:4001/images/avi.png", + avatar_static: "http://localhost:4001/images/avi.png", + header: "http://localhost:4001/images/banner.png", + header_static: "http://localhost:4001/images/banner.png", source: %{ note: "", privacy: "public", diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 3f84e4116..5aec757bc 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -33,8 +33,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do {:ok, user} = User.update_follower_count(user) Cachex.set(:user_cache, "user_info:#{user.id}", User.user_info(Repo.get!(User, user.id))) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => user.id, @@ -65,8 +65,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do test "A user for a given other follower", %{user: user} do {:ok, follower} = UserBuilder.insert(%{following: [User.ap_followers(user)]}) {:ok, user} = User.update_follower_count(user) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => user.id, @@ -98,8 +98,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do follower = insert(:user) {:ok, follower} = User.follow(follower, user) {:ok, user} = User.update_follower_count(user) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => follower.id, @@ -131,8 +131,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do user = insert(:user) blocker = insert(:user) User.block(blocker, user) - image = "http://localhost:4001/static/avi.png" - banner = "http://localhost:4001/static/banner.png" + image = "http://localhost:4001/images/avi.png" + banner = "http://localhost:4001/images/banner.png" represented = %{ "id" => user.id, -- cgit v1.2.3