Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinemde committed Sep 28, 2024
1 parent 8f476a4 commit b9d4595
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
12 changes: 6 additions & 6 deletions test/integration/api/v1/owner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions test/integration/gems_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
4 changes: 1 addition & 3 deletions test/integration/yank_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b9d4595

Please sign in to comment.