Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Services/Form/Project/ProjectFormLaravelValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ProjectFormLaravelValidator extends AbstractLaravelValidator
'stage' => 'required',
'recipe_id' => 'required',
'server_id' => 'required|exists:servers,id',
'repository' => 'required|url',
'repository' => 'required',
'deploy_path' => 'string',
'email_notification_recipient' => 'email',
'days_to_keep_deployments' => 'integer|min:1',
Expand Down
31 changes: 0 additions & 31 deletions tests/Services/Form/Project/ProjectFormLaravelValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,37 +115,6 @@ public function test_Should_FailToValidate_When_RepositoryFieldIsMissing()
$this->assertInstanceOf('Illuminate\Support\MessageBag', $errors);
}

public function test_Should_FailToValidate_When_RepositoryFieldIsInvalidUrl()
{
Factory::create('App\Models\Recipe', [
'name' => 'Recipe 1',
'description' => '',
'body' => '',
]);

Factory::create('App\Models\Server', [
'name' => 'Server 1',
'description' => '',
'body' => '',
]);

$input = [
'name' => 'Project 1',
'recipe_id' => [1],
'server_id' => 1,
'repository' => 'invalid_url',
'stage' => 'staging',
];

$form = new ProjectFormLaravelValidator($this->app['validator']);

$result = $form->with($input)->passes();
$errors = $form->errors();

$this->assertFalse($result, 'Expected validation to fail.');
$this->assertInstanceOf('Illuminate\Support\MessageBag', $errors);
}

public function test_Should_FailToValidate_When_StageFieldIsMissing()
{
Factory::create('App\Models\Recipe', [
Expand Down