diff options
Diffstat (limited to 'engines/support/test')
-rw-r--r-- | engines/support/test/integration/create_ticket_test.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/support/test/integration/create_ticket_test.rb b/engines/support/test/integration/create_ticket_test.rb index 59b263e..0f8453c 100644 --- a/engines/support/test/integration/create_ticket_test.rb +++ b/engines/support/test/integration/create_ticket_test.rb @@ -20,18 +20,22 @@ class CreateTicketTest < BrowserIntegrationTest click_on 'Get Help' fill_in 'Subject', with: 'test ticket' fill_in 'Email', with: 'invalid data' + fill_in 'Regarding user', with: 'some user' fill_in 'Description', with: 'description of the problem goes here' click_on 'Create Ticket' assert page.has_content?("is invalid") + assert_equal 'invalid data', find_field('Email').value + assert_equal 'some user', find_field('Regarding user').value end - test "prefills email when user has email service" do + test "prefills fields" do login FactoryGirl.create(:premium_user) visit '/' click_on "Support Tickets" click_on "New Ticket" email = "#{@user.login}@#{APP_CONFIG[:domain]}" assert_equal email, find_field('Email').value + assert_equal @user.login, find_field('Regarding user').value end test "no prefill of email without email service" do @@ -40,6 +44,7 @@ class CreateTicketTest < BrowserIntegrationTest click_on "Support Tickets" click_on "New Ticket" assert_equal "", find_field('Email').value + assert_equal @user.login, find_field('Regarding user').value end test "cleared email field should remain clear" do @@ -51,6 +56,9 @@ class CreateTicketTest < BrowserIntegrationTest fill_in 'Email', with: '' fill_in 'Description', with: 'description of the problem goes here' click_on 'Create Ticket' - assert_nil Ticket.last.email + ticket = Ticket.last + assert_equal "", ticket.email + ticket.destroy end + end |