Add flash notice after successful query_menu_items#create

pull/643/head
Till Breuer 11 years ago
parent e07a657328
commit 4d5259e688
  1. 6
      app/controllers/query_menu_items_controller.rb
  2. 1
      features/menu_items/query_menu_items.feature

@ -32,7 +32,11 @@ class QueryMenuItemsController < ApplicationController
def create
@query_menu_item = MenuItems::QueryMenuItem.find_or_initialize_by_name_and_navigatable_id normalized_query_name, @query.id, title: @query.name
flash[:error] = l(:error_menu_item_not_created) unless @query_menu_item.save
if @query_menu_item.save
flash[:notice] = l(:notice_successful_create)
else
flash[:error] = l(:error_menu_item_not_created)
end
redirect_to query_path
end

@ -59,6 +59,7 @@ Feature: Query menu items
And I click on "More functions"
And I click on "Add menu item"
Then I should see "Bugs" within "#main-menu"
And I should see "Successful creation."
@javascript
Scenario: Delete a query menu item

Loading…
Cancel
Save