+ test "an announce activity" do
+ user = insert(:user)
+ note_activity = insert(:note_activity)
+ activity_actor = Repo.get_by(User, ap_id: note_activity.data["actor"])
+ object = Object.get_by_ap_id(note_activity.data["object"]["id"])
+
+ {:ok, announce_activity, _object} = ActivityPub.announce(user, object)
+ note_activity = Activity.get_by_ap_id(note_activity.data["id"])
+
+ status = ActivityRepresenter.to_map(announce_activity, %{users: [user, activity_actor], announced_activity: note_activity, for: user})
+
+ assert status["id"] == announce_activity.id
+ assert status["user"] == UserView.render("show.json", %{user: user, for: user})
+
+ retweeted_status = ActivityRepresenter.to_map(note_activity, %{user: activity_actor, for: user})
+ assert retweeted_status["repeated"] == true
+ assert retweeted_status["id"] == note_activity.id
+ assert status["statusnet_conversation_id"] == retweeted_status["statusnet_conversation_id"]
+
+ assert status["retweeted_status"] == retweeted_status
+ assert status["activity_type"] == "repeat"
+ end
+