Github user nir-sopher commented on a diff in the pull request:

    
https://github.com/apache/incubator-trafficcontrol/pull/370#discussion_r113034286
  
    --- Diff: traffic_ops/app/t/api/1.2/user_admin.t ---
    @@ -0,0 +1,126 @@
    +package main;
    +#
    +#
    +# Licensed under the Apache License, Version 2.0 (the "License");
    +# you may not use this file except in compliance with the License.
    +# You may obtain a copy of the License at
    +#
    +#     http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
    +use Mojo::Base -strict;
    +use Test::More;
    +use Test::Mojo;
    +use DBI;
    +use Data::Dumper;
    +use strict;
    +use warnings;
    +use Schema;
    +use Test::TestHelper;
    +use Fixtures::TmUser;
    +use Fixtures::Deliveryservice;
    +use Digest::SHA1 qw(sha1_hex);
    +use Data::Dumper;
    +
    +#no_transactions=>1 ==> keep fixtures after every execution, beware of 
duplicate data!
    +#no_transactions=>0 ==> delete fixtures after every execution
    +
    +BEGIN { $ENV{MOJO_MODE} = "test" }
    +
    +sub run_ut {
    +   my $t = shift;
    +   my $schema = shift;
    +   my $login_user = shift;
    +   my $login_password = shift;
    +   
    +   Test::TestHelper->unload_core_data($schema);
    +   Test::TestHelper->teardown( $schema, 'Log' );
    +   Test::TestHelper->teardown( $schema, 'Role' );
    +   Test::TestHelper->teardown( $schema, 'TmUser' );
    +
    +   Test::TestHelper->load_core_data($schema);
    +
    +   my $tenant_id = $schema->resultset('TmUser')->find( { username => 
$login_user } )->get_column('tenant_id');
    +   my $tenant_name = defined ($tenant_id) ? 
$schema->resultset('Tenant')->find( { id => $tenant_id } )->get_column('name') 
: "null";
    +
    +   # Verify the user
    +   ok my $user = $schema->resultset('TmUser')->find( { username => 
$login_user } ), 'Does the portal user exist?';
    --- End diff --
    
    Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to