From 0e86214d1cbfb2ffe4ae49207c3eb479e09201c1 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Mon, 9 Jul 2018 10:35:57 +0300 Subject: [PATCH] Rewrite test to find the flash message --- test/integration/registrar/sign_in_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/registrar/sign_in_test.rb b/test/integration/registrar/sign_in_test.rb index ffbbf352e..cdf4dcd90 100644 --- a/test/integration/registrar/sign_in_test.rb +++ b/test/integration/registrar/sign_in_test.rb @@ -1,6 +1,8 @@ require 'test_helper' -class SignInTest < ActionDispatch::IntegrationTest +class RegistrarSignInTest < JavascriptIntegrationTest + self.use_transactional_fixtures = false + def setup super WebMock.allow_net_connect! @@ -26,7 +28,9 @@ class SignInTest < ActionDispatch::IntegrationTest fill_in 'user[phone]', with: '1234' click_button 'Login' - assert(page.has_text?('Confirmation sms was sent to your phone. Verification code is')) + flash_message = page.find('div.bg-success') + assert_equal('Confirmation sms was sent to your phone. Verification code is .', + flash_message.text) end end end