# -*-perl-*- use strict; use Test::More 'no_plan'; use lib "$ENV{LJHOME}/cgi-bin"; require 'ljlib.pl'; use LJ::Console; use LJ::Test qw (temp_user temp_comm); local $LJ::T_NO_COMMAND_PRINT = 1; my $u = temp_user(); my $u2 = temp_user(); LJ::set_remote($u); my $run = sub { my $cmd = shift; return LJ::Console->run_commands_text($cmd); }; ok($run->("contrib add " . $u2->user . " doc \"Kicking butt.\"") =~ /success:.*?(\d+)$/); my $coid = $1; ok($coid > 0, "Actually inserted a row"); #our remote needs to be ack'd to ack others ok($run->("contrib add " . $u->user . " doc lala") =~ /success:.*?(\d+)$/); LJ::Contrib::ack($1, $u->id); ok($run->("contrib ack $coid"), "success: Contribution acked."); ok(LJ::Contrib::is_acked($u2->id), "User is successfully acked!");