Test for /otr theirfp in non OTR window

This commit is contained in:
James Booth
2014-02-17 22:57:36 +00:00
parent a25714b6dc
commit b4b463998b
5 changed files with 34 additions and 0 deletions

View File

@@ -424,6 +424,23 @@ void cmd_otr_theirfp_shows_message_when_in_duck(void **state)
test_cmd_otr_theirfp_from_wintype(WIN_DUCK);
}
void cmd_otr_theirfp_shows_message_when_non_otr_chat_window(void **state)
{
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "theirfp", NULL };
mock_connection_status(JABBER_CONNECTED);
mock_current_win_type(WIN_CHAT);
ui_current_win_is_otr_returns(FALSE);
mock_ui_current_print_formatted_line();
ui_current_print_formatted_line_expect('!', 0, "You are not currently in an OTR session.");
gboolean result = cmd_otr(args, *help);
assert_true(result);
free(help);
}
#else
void cmd_otr_shows_message_when_otr_unsupported(void **state)
{