]> git.openstreetmap.org Git - rails.git/commitdiff
Add within_content_body system test helper
authorAnton Khorev <tony29@yandex.ru>
Sun, 29 Dec 2024 00:25:44 +0000 (03:25 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 29 Dec 2024 00:25:44 +0000 (03:25 +0300)
test/application_system_test_case.rb
test/system/user_signup_test.rb

index d2c3d5196ab9b5ccbcae32aaaed086e03650d7f5..0ddb8a87ad73f91606df90af224df851c9919c06 100644 (file)
@@ -41,4 +41,8 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
   def within_sidebar(&)
     within("#sidebar_content", &)
   end
+
+  def within_content_body(&)
+    within("#content > .content-body", &)
+  end
 end
index 0e02b904f7f44a830fa5d2eba043fef1e7c70ba6..38690d3d955af66ceb4725bd80e2ff86748cc2e5 100644 (file)
@@ -6,18 +6,22 @@ class UserSignupTest < ApplicationSystemTestCase
 
     click_on "Sign up"
 
-    assert_content "Confirm Password"
+    within_content_body do
+      assert_content "Confirm Password"
+    end
   end
 
   test "Show OpenID form when OpenID provider button is clicked" do
     visit login_path
 
-    assert_no_field "OpenID URL"
-    assert_no_button "Continue"
+    within_content_body do
+      assert_no_field "OpenID URL"
+      assert_no_button "Continue"
 
-    click_on "Log in with OpenID"
+      click_on "Log in with OpenID"
 
-    assert_field "OpenID URL"
-    assert_button "Continue"
+      assert_field "OpenID URL"
+      assert_button "Continue"
+    end
   end
 end