1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Test "/account add" shows message on success

This commit is contained in:
James Booth 2013-12-15 23:39:04 +00:00
parent 85629cb9a3
commit b2f4570886
3 changed files with 18 additions and 0 deletions

View File

@ -149,3 +149,19 @@ void cmd_account_add_adds_account(void **state)
free(help);
}
void cmd_account_add_shows_message(void **state)
{
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "add", "new_account", NULL };
expect_any(accounts_add, jid);
expect_string(cons_show, output, "Account created.");;
expect_string(cons_show, output, "");
gboolean result = cmd_account(args, *help);
assert_true(result);
free(help);
}

View File

@ -6,3 +6,4 @@ void cmd_account_show_shows_message_when_account_does_not_exist(void **state);
void cmd_account_show_shows_message_when_account_exists(void **state);
void cmd_account_add_shows_usage_when_no_arg(void **state);
void cmd_account_add_adds_account(void **state);
void cmd_account_add_shows_message(void **state);

View File

@ -36,6 +36,7 @@ int main(int argc, char* argv[]) {
unit_test(cmd_account_show_shows_message_when_account_exists),
unit_test(cmd_account_add_shows_usage_when_no_arg),
unit_test(cmd_account_add_adds_account),
unit_test(cmd_account_add_shows_message),
unit_test(cmd_rooms_shows_message_when_disconnected),
unit_test(cmd_rooms_shows_message_when_disconnecting),