diff --git tests/testcases/activity/functions.php tests/testcases/activity/functions.php
index 1184247..d4b1b71 100644
--- tests/testcases/activity/functions.php
+++ tests/testcases/activity/functions.php
@@ -522,4 +522,41 @@ Bar!';
 		remove_filter( 'bp_is_username_compatibility_mode', '__return_true' );
 	}
 
+	/**
+	 * @group mentions
+	 */
+	public function test_at_name_filter() {
+		$u1 = $this->create_user( array(
+			'user_login' => 'foobarbaz',
+			'user_nicename' => 'foobarbaz',
+			'user_email' => 'test@example.org',
+		) );
+
+		$u2 = $this->create_user( array(
+			'user_login' => 'test2@example.org',
+			'user_nicename' => 'foo-bar-baz',
+			'user_email' => 'test2@example.org',
+		) );
+
+		$user_mention_name = bp_activity_get_user_mentionname( $u1 );
+		$user_domain = bp_core_get_user_domain( $u1 );
+
+		// mentions normal text should be replaced
+		$at_name_in_text = sprintf( 'Hello @%s', $user_mention_name );
+		$at_name_in_text_final = "<p>Hello <a href='" . $user_domain . "' rel='nofollow'>@$user_mention_name</a></p>\n";
+		$this->assertEquals( $at_name_in_text_final, apply_filters( 'the_content', $at_name_in_text ) );
+
+		// non users shouldn't be linked
+		$this->assertEquals( "<p>Content with @example.org shouldn&#8217;t link @example.org</p>\n", apply_filters( 'the_content', "Content with @example.org shouldn't link @example.org" ) );
+
+		// mentions inside links sholudn't be replaced
+		$at_name_in_mailto = sprintf( "Send messages to <a href='mail@%s.com'>Foo Bar Baz</a>", $user_mention_name );
+		$at_name_in_mailto_final = sprintf( "<p>Send messages to <a href='mail@%s.com'>Foo Bar Baz</a></p>\n", $user_mention_name );
+		$this->assertEquals( $at_name_in_mailto_final, apply_filters( 'the_content', $at_name_in_mailto ) );
+
+		$at_name_in_link = sprintf( '<a href="https://twitter.com/%1$s">@%1$s</a>', $user_mention_name );
+		$at_name_in_link_final = sprintf( '<p><a href="https://twitter.com/%1$s">@%1$s</a></p>' . "\n", $user_mention_name );
+		$this->assertEquals( $at_name_in_link_final, apply_filters( 'the_content', $at_name_in_link ) );
+	}
+
 }
