remove validation and add specs
This commit is contained in:
@@ -91,6 +91,21 @@ feature "User managing task requests" do
|
||||
expect(page).to have_content add_new_project_label
|
||||
end
|
||||
|
||||
scenario "user can click Chat Now and start chat event with a blank form" do
|
||||
visit project_task_requests_path(project)
|
||||
|
||||
click_on create_task_request
|
||||
|
||||
expect(page).to have_content chat_now_button
|
||||
expect(page).to have_content form_notice
|
||||
|
||||
expect do
|
||||
click_on chat_now_button
|
||||
end.to change(TaskRequest, :count).by(1)
|
||||
|
||||
expect(page).to have_content task_request_created_notice
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def no_task_requests_label
|
||||
@@ -120,4 +135,20 @@ feature "User managing task requests" do
|
||||
def schedule_demo
|
||||
t 'task_requests.splash.actions.book_demo'
|
||||
end
|
||||
|
||||
def create_task_request
|
||||
t 'task_requests.index.actions.new'
|
||||
end
|
||||
|
||||
def chat_now_button
|
||||
t 'task_requests.form.actions.chat_now'
|
||||
end
|
||||
|
||||
def form_notice
|
||||
t 'task_requests.form.info_message'
|
||||
end
|
||||
|
||||
def task_request_created_notice
|
||||
t 'task_requests.create.success_message'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user