NAME

Smolder::TestData

SYNOPSIS

use Smolder::TestData qw(create_project delete_projects);
my $proj1 = create_project();
my $proj2 = create_project();
delete_projects();

DESCRIPTION

This module provides some routines that are useful for testing.

ROUTINES

create_project

Will create a Smolder::DB::Project object and return it. Name-value args may be passed in to override the defaults.

my $proj1 = create_project();
my $proj2 = create_project(name => 'stuff');

delete_projects

Will delete all projects that were created by create_project.

create_developer

Will create a Smolder::DB::Developer object and return it. Name-value args may be passed in to override the defaults.

my $proj1 = create_project();
my $proj2 = create_project(name => 'stuff');

delete_developers

Will delete all developers that were created by create_developer.

create_preference

Will create a Smolder::DB::Preference object and return it. Name-value args may be passed in to override the defaults.

my $proj1 = create_project();
my $proj2 = create_project(name => 'stuff');

delete_preferences

Will delete all preferences that were created by create_preference.

create_smoke_report

Will create a Smolder::DB::SmokeReport object and return it. Name-value args may be passed in to override the defaults. You must provide both a project and a developer upon creation.

my $report  = create_smoke_report(
    project     => $project,
    developer   => $dev,
);
my $report2 = create_smoke_report(
    platform    => 'Windows NT',
    project     => $project,
    developer   => $dev,
);

delete_smoke_reports

Will delete all test reports create by create_smoke_report.

delete_tags

Delete the tags with the given names

delete_tags('foo', 'bar');

is_smolder_running

Returns true if Smolder is up and running. Else returns false. Perfect to use in controller tests that will skip the test if it's not running.

base_url

Returns the base url for the dynamic portions of the site.

db_field_value

Returns the value for a given database field given the table, field and id.

db_field_value('developer', 'password', '23');