Files
sure/test/controllers/lunchflow_items_controller_test.rb
T
sentry[bot]sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>Juan José Mata
fb47e40247 Fix(lunchflow): Missing template on validation failure in create action (#2724)
* Fix(lunchflow): Missing template on validation failure in create action

* Test invalid Lunchflow connection creation

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2026-08-27 08:56:23 +02:00

22 lines
559 B
Ruby

require "test_helper"
class LunchflowItemsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in @user = users(:family_admin)
end
test "invalid non-Turbo create redirects instead of rendering a missing template" do
assert_no_difference "LunchflowItem.count" do
post lunchflow_items_url, params: {
lunchflow_item: {
name: "Invalid Lunchflow connection",
api_key: ""
}
}
end
assert_redirected_to accounts_path
assert_match "Api key can't be blank", flash[:alert]
end
end