Skip to content

Commit

Permalink
Merge pull request #459 from kilip/mail-test
Browse files Browse the repository at this point in the history
Mail Test
  • Loading branch information
cbleek committed Feb 1, 2018
2 parents 6bec98b + 18e3af6 commit 3062c07
Show file tree
Hide file tree
Showing 22 changed files with 881 additions and 123 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -31,6 +31,7 @@ before_script:
# copy default app config
- mkdir -p config/autoload
- mkdir -p build/behat
- mkdir -p build/mails
- cp .travis/autoload/*.* config/autoload

# install Mongo extension
Expand Down
60 changes: 3 additions & 57 deletions .travis/autoload/MailServiceOptions.config.local.php
Expand Up @@ -10,68 +10,14 @@
* @license MIT
*/

/**
* Mail transport. Possible Values "smtp", "sendmail". If "sendmail" is used, YAWIK will use the php mail() function
* for sending mails. This requires a local MTA.
*
* @var string
*/
$transport = 'smtp';

/**
* Fully-qualified classname or short name resolvable via Zend\Mail\Protocol\SmtpLoader.
* Typically, this will be one of “smtp”, “plain”, “login”, or “crammd5”, and defaults to “smtp”.
*/
$auth = 'login';

/**
* @var string Local client hostname
*/
$name = 'localhost';

/**
* 'ssl' or 'tls' one null.
*/
$ssl = "tls";

/**
* @var string Remote SMTP hostname or IP
*/
$host = 'smtp.gmail.com';

/**
* @var int
*/
$port = 587;

/**
* Username
*/
$username = '';

/**
* password
*/
$password = '';


//
// Do not change below this line!
//

$config = [
'options' => [
'Core/MailServiceOptions' => [
'options' => [
'name' => $name,
'connectionClass' => $auth,
'host' => $host,
'port' => $port,
'username' => $username,
'password' => $password,
'ssl' => $ssl,
'transportClass' => 'file',
'path' => realpath(__DIR__.'/../../build/mails')
],
],
]
];
return $config;
return $config;
32 changes: 0 additions & 32 deletions .travis/autoload/core.mails.development.php

This file was deleted.

3 changes: 2 additions & 1 deletion behat.yml.dist
Expand Up @@ -36,7 +36,7 @@ default:

gherkin:
filters:
tags: "~@mail && ~@social-profile"
tags: "~@social-profile"

suites:
user:
Expand All @@ -52,3 +52,4 @@ default:
- Yawik\Behat\SummaryFormContext
- Yawik\Behat\CvContext
- Yawik\Behat\InstallContext
- Yawik\Behat\MailContext
2 changes: 0 additions & 2 deletions features/cv/update.feature
Expand Up @@ -35,5 +35,3 @@ Feature: Resume Management
And I should see "654321"
And I should see "test@resume.com"

Scenario: Change resume visibility

6 changes: 5 additions & 1 deletion features/jobs/publish.feature
Expand Up @@ -20,7 +20,7 @@ Feature: Publish Job
And I am logged in as "test@recruiter.com" identified by "test"

# disabled because we can not test email feature on travis
@javascript @mail
@jobs @mail
Scenario: Successfully publish a job
Given I go to edit job draft with title "Test Publishing a Job"
And I wait for the ajax response
Expand All @@ -36,3 +36,7 @@ Feature: Publish Job
And I follow "Publish job"
And I wait for the ajax response
Then I should see "Publishing successfully finished"
And an email should be sent to "test@recruiter.com"
And an email should be sent from "email@example.com"
And sent email should be contain "Click here to accept or reject the job opening"
And sent email should be contain "We hereby acknowledge receipt of your job announcement"
11 changes: 7 additions & 4 deletions features/organization/update.feature
Expand Up @@ -7,7 +7,7 @@ Feature: Updating my organization
Given I am logged in as a recruiter
And I go to my organization page

@organization-name
@organization
Scenario: Updating Name
When I click edit on name form
And I wait for the ajax response
Expand All @@ -16,7 +16,7 @@ Feature: Updating my organization
And I wait for the ajax response
Then I should see "Some Organization"

@organization-location
@organization
Scenario: Updating Location
When I click edit on location form
And I wait for the ajax response
Expand All @@ -36,7 +36,7 @@ Feature: Updating my organization
And I should see "123123"
And I should see "321321"

@organization-employee @mail
@organization @mail
Scenario: Invite employee
When I click edit on name form
And I wait for the ajax response
Expand All @@ -50,8 +50,11 @@ Feature: Updating my organization
And I wait for the ajax response
And I wait for 5 seconds
Then I should see "test.invite@example.com"
And an email should be sent to "test.invite@example.com"
And an email should be sent from "email@example.com"
And sent email should be contain "Test Recruiter invited you"

@organization-workflow
@organization
Scenario: Setup Workflow
When I click edit on workflow form
And I uncheck "accept Applications by Department Managers"
Expand Down
4 changes: 2 additions & 2 deletions module/Behat/src/JobContext.php
Expand Up @@ -229,8 +229,8 @@ public function iHaveAJobWithTheFollowing($status,TableNode $fields)
}
if(isset($normalizedField['user'])){
/* @var $userRepo UserRepository */
$userRepo = $this->getRepository('Auth\Entity\User');
$user = $userRepo->findOneBy(['login' => $normalizedField['user']]);
$user = $this->getUserContext()->getCurrentUser();
$jobRepo->getDocumentManager()->refresh($user);
if($user instanceof User){
$job->setUser($user);
$job->setOrganization($user->getOrganization()->getOrganization());
Expand Down

0 comments on commit 3062c07

Please sign in to comment.