mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: creating an automation without script should error (#28752)
This commit ensure we are properly showing an error to the end user and not just a vague 500.
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class NewAutomation < PageObjects::Pages::Base
|
||||
def visit
|
||||
super("/admin/plugins/discourse-automation/new")
|
||||
self
|
||||
end
|
||||
|
||||
def fill_name(name)
|
||||
find_field("automation-name").fill_in(with: name)
|
||||
self
|
||||
end
|
||||
|
||||
def create
|
||||
find(".create-automation").click
|
||||
self
|
||||
end
|
||||
|
||||
def has_error?(message)
|
||||
find(".form-errors").has_text?(message)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user