Commit df5c2a7a authored by Matt Glaman's avatar Matt Glaman

Issue #2264127: display_products view should filter out unpublished products

parent 44b7cec8
......@@ -60,6 +60,13 @@ function commerce_kickstart_search_views_default_views() {
$handler->display->display_options['filters']['search_api_views_fulltext']['expose']['operator_id'] = 'search_api_views_fulltext_op';
$handler->display->display_options['filters']['search_api_views_fulltext']['expose']['operator'] = 'search_api_views_fulltext_op';
$handler->display->display_options['filters']['search_api_views_fulltext']['expose']['identifier'] = 'search_api_views_fulltext';
/* Filter criterion: Indexed Node: Status */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'search_api_index_product_display';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = array(
1 => '1',
);
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
......
......@@ -49,3 +49,28 @@ Feature: Create products
Then I should see "Bags & Cases Supercool bag has been created"
When I click "Edit" in the "Tabs" region
Then I should see "Supercool bag (Blue, One Size)"
@api
Scenario: Make sure that unpublished products are not shown #2264127
When I am logged in as a user with the "administrator" role
And I click "Products"
And I click "Add product"
And I click "Bags & Cases"
And I fill in "Title" with "Supercool unpublished bag"
And I fill in "Body" with "Buy this supercool bag"
And I select "Blue" from "Color"
And I select "One Size" from "Size"
And I fill in "Price" with "20"
And I select "To carry" from "Collection"
And I select "Messenger Bags" from "Category"
And I select "Unisex" from "Gender"
And I select "iSleeve" from "Brand"
And I uncheck the box "Published"
When I press "Save"
Then I should see "Bags & Cases Supercool unpublished bag has been created"
When I click "To carry"
Then I should not see "Supercool unpublished bag"
When I fill in "Search" with "Supercool unpublished bag"
And I press "edit-submit-display-products"
Then I should see "There are 0 search results"
And I should see "No results found for your search."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment