Skip to content

Commit

Permalink
Merge pull request #1558 from kareila/fix-post-tests
Browse files Browse the repository at this point in the history
fixes for atom-post.t and post.t
  • Loading branch information
zorkian committed Aug 29, 2015
2 parents b392771 + eb08e39 commit cc956de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion t/atom-post.t
Expand Up @@ -38,6 +38,8 @@ use DW::Routing;
# so that entries can be posted to community journals
$LJ::EVERYONE_VALID = 1;

$LJ::USE_SSL = 1 if $LJ::USE_HTTPS_EVERYWHERE && $LJ::SSLROOT;

my $u = temp_user();
my $pass = "foopass";
$u->set_password( $pass );
Expand All @@ -53,11 +55,12 @@ sub do_request {
my $remote = delete $opts{remote} || $u;
my $password = delete $opts{password} || $remote->password;

$uri =~ m!http://([^.]+)!;
$uri =~ m!https?://([^.]+)!;
my $user_subdomain = $1 eq "www" ? "" : $1;

my %routing_data = ();
$routing_data{username} = $user_subdomain if $user_subdomain;
$routing_data{ssl} = 1 if $LJ::USE_SSL;

my $input = delete $data->{input};

Expand Down
7 changes: 5 additions & 2 deletions t/post.t
Expand Up @@ -145,8 +145,11 @@ note( "Logged in - init" );
$u->update_self( { moodthemeid => $customtheme->id } );
$u = LJ::load_user($u->user, 'force');

# pick a mood, any mood
my $testmoodid = (keys %$moods)[0];
# we used to pick a random mood here - whichever moodid was the
# first one returned from the keys array - but the test would
# fail if we picked a mood that had other moods inherit from it,
# so now we pick a mood that is known to be childless
my $testmoodid = 105; # quixotic
my $err;
$customtheme->set_picture( $testmoodid, { picurl => "http://example.com/moodpic", width => 10, height => 20 }, \$err );

Expand Down

0 comments on commit cc956de

Please sign in to comment.