From 5d6a82a67bffc0930ea480164be2aca60ea0d6a1 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 22 Apr 2014 14:44:11 +0200 Subject: add tests for invalid ticket creation --- .../support/test/integration/create_ticket_test.rb | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 engines/support/test/integration/create_ticket_test.rb (limited to 'engines/support/test/integration/create_ticket_test.rb') diff --git a/engines/support/test/integration/create_ticket_test.rb b/engines/support/test/integration/create_ticket_test.rb new file mode 100644 index 0000000..2583fc7 --- /dev/null +++ b/engines/support/test/integration/create_ticket_test.rb @@ -0,0 +1,28 @@ +require 'test_helper' + +class CreateTicketTest < BrowserIntegrationTest + + test "can submit ticket anonymously" do + visit '/' + click_on 'Get Help' + fill_in 'Subject', with: 'test ticket' + fill_in 'Description', with: 'description of the problem goes here' + click_on 'Create Ticket' + assert page.has_content?("Ticket was successfully created.") + assert page.has_content?("You can later access this ticket at the URL") + assert page.has_content?(current_url) + assert ticket = Ticket.last + ticket.destroy + end + + test "get help when creating ticket with invalid email" do + visit '/' + click_on 'Get Help' + fill_in 'Subject', with: 'test ticket' + fill_in 'Email', with: 'invalid data' + fill_in 'Description', with: 'description of the problem goes here' + click_on 'Create Ticket' + assert page.has_content?("is invalid") + end + +end -- cgit v1.2.3