From b4b463998bec925c9f04def3ce48bbd475fd8aae Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 17 Feb 2014 22:57:36 +0000 Subject: Test for /otr theirfp in non OTR window --- tests/test_cmd_otr.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_cmd_otr.c') diff --git a/tests/test_cmd_otr.c b/tests/test_cmd_otr.c index 34496ea1..f16eee19 100644 --- a/tests/test_cmd_otr.c +++ b/tests/test_cmd_otr.c @@ -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) { -- cgit 1.4.1-2-gfad0