about summary refs log tree commit diff stats
path: root/tests/test_cmd_otr.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-17 22:14:33 +0000
committerJames Booth <boothj5@gmail.com>2014-02-17 22:14:33 +0000
commit4afec6ab5e6385e15e605130e5f275aa759fab9a (patch)
tree895a80672418c4507cca95da95f0fb0c868c5633 /tests/test_cmd_otr.c
parent82ad0cd306968ae6821127829e9d52f01932e82e (diff)
downloadprofani-tty-4afec6ab5e6385e15e605130e5f275aa759fab9a.tar.gz
Added test for /otr theirfp when in console
Diffstat (limited to 'tests/test_cmd_otr.c')
-rw-r--r--tests/test_cmd_otr.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_cmd_otr.c b/tests/test_cmd_otr.c
index 9a731d12..707bb3d2 100644
--- a/tests/test_cmd_otr.c
+++ b/tests/test_cmd_otr.c
@@ -387,6 +387,22 @@ void cmd_otr_myfp_shows_my_fingerprint(void **state)
     free(help);
 }
 
+void cmd_otr_theirfp_shows_message_when_in_console(void **state)
+{
+    CommandHelp *help = malloc(sizeof(CommandHelp));
+    gchar *args[] = { "theirfp", NULL };
+    mock_connection_status(JABBER_CONNECTED);
+    mock_current_win_type(WIN_CONSOLE);
+    mock_ui_current_print_line();
+
+    ui_current_print_line_expect("You must be in a regular chat window to view a recipient's fingerprint.");
+
+    gboolean result = cmd_otr(args, *help);
+    assert_true(result);
+
+    free(help);
+}
+
 #else
 void cmd_otr_shows_message_when_otr_unsupported(void **state)
 {