+ test "A user that follows you", %{user: user} do
+ follower = insert(:user)
+ {:ok, follower} = User.follow(follower, user)
+ {:ok, user} = User.update_follower_count(user)
+ image = "http://localhost:4001/images/avi.png"
+ banner = "http://localhost:4001/images/banner.png"
+
+ represented = %{
+ "id" => follower.id,
+ "name" => follower.name,
+ "screen_name" => follower.nickname,
+ "screen_name_html" => follower.nickname,
+ "description" => HtmlSanitizeEx.strip_tags(follower.bio),
+ "description_html" => HtmlSanitizeEx.strip_tags(follower.bio),
+ "created_at" => follower.inserted_at |> Utils.format_naive_asctime(),
+ "favourites_count" => 0,
+ "statuses_count" => 0,
+ "friends_count" => 1,
+ "followers_count" => 0,
+ "profile_image_url" => image,
+ "profile_image_url_https" => image,
+ "profile_image_url_profile_size" => image,
+ "profile_image_url_original" => image,
+ "following" => false,
+ "follows_you" => true,
+ "statusnet_blocking" => false,
+ "rights" => %{
+ "delete_others_notice" => false
+ },
+ "statusnet_profile_url" => follower.ap_id,
+ "cover_photo" => banner,
+ "background_image" => nil,
+ "is_local" => true,
+ "locked" => false,
+ "default_scope" => "public"
+ }
+
+ assert represented == UserView.render("show.json", %{user: follower, for: user})
+ end
+
+ test "a user that is a moderator" do
+ user = insert(:user, %{info: %{"is_moderator" => true}})
+ represented = UserView.render("show.json", %{user: user, for: user})
+
+ assert represented["rights"]["delete_others_notice"]
+ end
+
+ test "A blocked user for the blocker" do