@@ -8,6 +8,7 @@ use MetaCPAN::Script::CPANTesters ();
88use MetaCPAN::Script::Latest;
99use MetaCPAN::Script::Mapping;
1010use MetaCPAN::Script::Release;
11+ use MetaCPAN::Server ();
1112use MetaCPAN::TestHelpers qw( get_config fakecpan_dir ) ;
1213use MetaCPAN::Types qw( Dir HashRef Str ) ;
1314use Search::Elasticsearch;
@@ -167,7 +168,8 @@ sub index_releases {
167168 my $self = shift ;
168169 my %args = @_ ;
169170
170- local @ARGV = ( ' release' , $ENV {MC_RELEASE } ? $ENV {MC_RELEASE } : $self -> _cpan_dir );
171+ local @ARGV = ( ' release' ,
172+ $ENV {MC_RELEASE } ? $ENV {MC_RELEASE } : $self -> _cpan_dir );
171173 ok(
172174 MetaCPAN::Script::Release-> new_with_options( %{ $self -> _config },
173175 %args )-> run,
@@ -188,6 +190,7 @@ sub index_authors {
188190 local @ARGV = (' author' );
189191 ok( MetaCPAN::Script::Author-> new_with_options( $self -> _config )-> run,
190192 ' index authors' );
193+ $self -> prepare_user_test_data;
191194}
192195
193196# Right now this test requires you to have an internet connection. If we can
@@ -204,5 +207,31 @@ sub index_cpantesters {
204207 );
205208}
206209
210+ sub prepare_user_test_data {
211+ my $self = shift ;
212+ ok(
213+ my $user = MetaCPAN::Server-> model(' User::Account' )-> put(
214+ {
215+ access_token =>
216+ [ { client => ' testing' , token => ' testing' } ]
217+ }
218+ ),
219+ ' prepare user'
220+ );
221+ use DDP;
222+ p $user ;
223+ ok( $user -> add_identity( { name => ' pause' , key => ' MO' } ),
224+ ' add pause identity' );
225+ ok( $user -> put( { refresh => 1 } ), ' put user' );
226+
227+ ok(
228+ MetaCPAN::Server-> model(' User::Account' )-> put(
229+ { access_token => [ { client => ' testing' , token => ' bot' } ] },
230+ { refresh => 1 }
231+ ),
232+ ' put bot user'
233+ );
234+ }
235+
207236__PACKAGE__ -> meta-> make_immutable;
2082371;
0 commit comments