From b9d4595b3995000293275a2b3f3ac87f82239513 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Sat, 31 Aug 2024 14:55:40 -0700 Subject: [PATCH] fix tests --- test/integration/api/v1/owner_test.rb | 12 ++++++------ test/integration/gems_test.rb | 2 -- test/integration/yank_test.rb | 4 +--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/test/integration/api/v1/owner_test.rb b/test/integration/api/v1/owner_test.rb index 936b49c6124..4bcdba04b41 100644 --- a/test/integration/api/v1/owner_test.rb +++ b/test/integration/api/v1/owner_test.rb @@ -29,8 +29,8 @@ class Api::V1::OwnerTest < ActionDispatch::IntegrationTest get rubygem_path(@rubygem.slug) - assert page.has_selector?("a[alt='#{@user.handle}']") - assert page.has_selector?("a[alt='#{@other_user.handle}']") + page.assert_selector("div.gem__members a", text: @user.handle) + page.assert_selector("div.gem__members a", text: @other_user.handle) end test "removing an owner" do @@ -41,8 +41,8 @@ class Api::V1::OwnerTest < ActionDispatch::IntegrationTest get rubygem_path(@rubygem.slug) - assert page.has_selector?("a[alt='#{@user.handle}']") - refute page.has_selector?("a[alt='#{@other_user.handle}']") + page.assert_selector("div.gem__members a", text: @user.handle) + page.assert_no_selector("div.gem__members a", text: @other_user.handle) end test "transferring ownership" do @@ -54,8 +54,8 @@ class Api::V1::OwnerTest < ActionDispatch::IntegrationTest get rubygem_path(@rubygem.slug) - refute page.has_selector?("a[alt='#{@user.handle}']") - assert page.has_selector?("a[alt='#{@other_user.handle}']") + page.assert_no_selector("div.gem__members a", text: @user.handle) + page.assert_selector("div.gem__members a", text: @other_user.handle) end test "adding ownership without permission" do diff --git a/test/integration/gems_test.rb b/test/integration/gems_test.rb index 4a16312365f..e4710fa6508 100644 --- a/test/integration/gems_test.rb +++ b/test/integration/gems_test.rb @@ -114,7 +114,6 @@ class GemsSystemTest < SystemTest visit rubygem_path(@rubygem.slug, as: @user.id) - assert page.has_selector?(".gem__users__mfa-disabled .gem__users a") assert page.has_content? "Please consider enabling multi-factor" end @@ -127,7 +126,6 @@ class GemsSystemTest < SystemTest visit rubygem_path(@rubygem.slug, as: @user.id) - assert page.has_selector?(".gem__users__mfa-disabled .gem__users a") assert page.has_selector?(".gem__users__mfa-text.mfa-warn") end diff --git a/test/integration/yank_test.rb b/test/integration/yank_test.rb index 3d433b0da4d..e9c8e342b18 100644 --- a/test/integration/yank_test.rb +++ b/test/integration/yank_test.rb @@ -42,9 +42,7 @@ class YankTest < SystemTest assert page.has_content?("Yanked by") - css = %(div.gem__users a[alt=#{@user.handle}]) - - assert page.has_css?(css, count: 3) + assert_selector("div.gem__members a", text: @user.handle) assert_event Events::RubygemEvent::VERSION_YANKED, { number: "2.2.2",