diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index a184cf99d6..8327c4f1cc 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -7,14 +7,6 @@ module Admin helper 'spree/products' - respond_override update: { html: { success: lambda { - if params[:enterprise].key? :producer_properties_attributes - redirect_to main_app.admin_enterprise_producer_properties_path(@enterprise) - else - redirect_to main_app.admin_enterprises_path - end - } } } - def bulk_update @enterprise_set = EnterpriseSet.new(params[:enterprise_set]) diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 8070691302..df3198b757 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -175,8 +175,8 @@ feature %q{ fill_in 'enterprise_producer_properties_attributes_0_value', with: "NASAA 12345" click_button 'Update' - # Then I should be returned to the producer properties page - page.should have_selector 'h1.page-title', text: "Producer Properties" + # Then I should be returned to the enterprises page + page.should have_selector '#listing_enterprises a', text: s.name # And the producer should have the property s.producer_properties(true).count.should == 1 @@ -198,8 +198,8 @@ feature %q{ fill_in 'enterprise_producer_properties_attributes_0_value', with: "Shininess" click_button 'Update' - # Then I should be returned to the producer properties page - page.should have_selector 'h1.page-title', text: "Producer Properties" + # Then I should be returned to the enterprises + page.should have_selector '#listing_enterprises a', text: s.name # And the property should be updated s.producer_properties(true).count.should == 1 @@ -221,8 +221,8 @@ feature %q{ within("#spree_producer_property_#{pp.id}") { page.find('a.remove_fields').click } # Then the property should have been removed - page.should_not have_field 'enterprise_producer_properties_attributes_0_property_name', with: 'Certified Organic' page.should_not have_selector '#progress' + page.should_not have_field 'enterprise_producer_properties_attributes_0_property_name', with: 'Certified Organic' s.producer_properties(true).should be_empty end end