1 ## a simple test for the organism ajax functions
2 ## Lukas Mueller, Jan 2011
7 use SGN::Test::Data qw/create_test/;
8 use SGN::Test::WWW::Mechanize;
10 my $mech = SGN::Test::WWW::Mechanize->new();
12 $mech->with_test_level( local => sub {
14 my $organism = create_test('Organism::Organism', {
18 my $o_id = $organism->organism_id;
20 # diag("created temp organism $o_id");
22 $mech->get_ok("/organism/$o_id/metadata/?action=view");
24 $mech->content_contains('html');
26 $mech->while_logged_in( { user_type=>'submitter' }, sub {
27 $mech->get_ok("/organism/$o_id/metadata/?action=store&genome_project_funding_agencies=NSF&object_id=-$o_id") or diag $mech->content();
28 $mech->content_contains('success');
29 $mech->get_ok("/organism/$o_id/metadata/?action=view");
30 $mech->content_contains('NSF');
31 $mech->get_ok("/organism/$o_id/metadata/?action=store&genome_project_funding_agencies=USDA&object_id=-$o_id");
32 $mech->content_contains('success');
33 $mech->get_ok("/organism/$o_id/metadata/?action=view");
34 $mech->content_contains('USDA');