Fix and merge search scenarios, run them on travis

This commit is contained in:
Paweł Jędrzejewski 2014-12-17 10:45:26 +01:00
parent 790ee2f392
commit f7b211cdf6
6 changed files with 12 additions and 10 deletions

View file

@ -297,6 +297,7 @@ default:
- Sylius\Bundle\ShippingBundle\Behat\ShippingContext
- Sylius\Bundle\WebBundle\Behat\WebContext
- Sylius\Bundle\MoneyBundle\Behat\MoneyContext
- Sylius\Bundle\TaxonomyBundle\Behat\TaxonomyContext
filters:
tags: "@search"

View file

@ -1,4 +1,4 @@
@search_orm_only
@search
Feature: Orm indexer event listener
In order to have a consistent indexing when orm is enabled
As a administrator
@ -7,6 +7,9 @@ Feature: Orm indexer event listener
Background:
Given there is default currency configured
And I am logged in as administrator
And there are following locales configured:
| code | enabled |
| en | yes |
And there are following taxonomies defined:
| name |
| Category |
@ -22,10 +25,6 @@ Feature: Orm indexer event listener
| Symfony T-Shirt | 15.00 | PHP T-Shirts | symfony t-shirt |
| Doctrine T-Shirt | 15.00 | PHP T-Shirts | doctrine t-shirt |
Scenario: Viewing the dashboard at website root
Given I am on the dashboard page
Then I should see "Administration dashboard"
Scenario: Creating simple product and indexing it
Given I am on the product creation page
When I fill in the following:
@ -50,4 +49,4 @@ Feature: Orm indexer event listener
When I press "delete"
Then I should be on the product index page
And I should see "Product has been successfully deleted."
And I should not find an indexed entry for "a very nice php t-shirt"
And I should not find an indexed entry for "a very nice php t-shirt"

View file

@ -83,7 +83,7 @@ class SearchContext extends DefaultContext
$queryBuilder = $em->createQueryBuilder();
$queryBuilder
->select('u')
->from('Sylius\Bundle\SearchBundle\Entity\SearchIndex', 'u')
->from('Sylius\Bundle\SearchBundle\Model\SearchIndex', 'u')
->where('u.value LIKE :id')
->setParameter('id', '%'.$id.'%')
;

View file

@ -258,8 +258,9 @@ class OrmIndexer implements IndexerInterface
public function isObjectIndexable($object)
{
$class = get_class($object);
foreach ($this->config['orm_indexes'] as $index) {
if ($index['class'] === $class && 'orm' === $this->config['driver']) {
if ($index['class'] === $class && 'doctrine/orm' === $this->config['driver']) {
return true;
}
}

View file

@ -20,7 +20,7 @@ class SearchIndexSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Sylius\Bundle\SearchBundle\Entity\SearchIndex');
$this->shouldHaveType('Sylius\Bundle\SearchBundle\Model\SearchIndex');
}
function its_item_id_is_mutable()
@ -53,4 +53,4 @@ class SearchIndexSpec extends ObjectBehavior
$this->getCreatedAt()->shouldReturn('2014-08-08 15:53:07');
}
}
}

View file

@ -12,6 +12,7 @@ bin/behat --suite=shipping -fprogress || EXIT_STATUS=$?
bin/behat --suite=taxation -fprogress || EXIT_STATUS=$?
bin/behat --suite=taxonomies -fprogress || EXIT_STATUS=$?
bin/behat --suite=users -fprogress || EXIT_STATUS=$?
bin/behat --suite=search -fprogress || EXIT_STATUS=$?
#bin/behat --stop-on-failure --suite=javascript || EXIT_STATUS=$?