Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
test-unit-capybara is a Capybara adapter for test-unit 2. You can get Capybara integrated Test::Unit::TestCase. It also provides useful assertions for Capybara.
% sudo gem install test-unit-capybara
require 'test/unit/capybara'
class MyRackApplication
def call(env)
html = <<-HTML
<html>
<head>
<title>Welcome! - my site</title>
</head>
<body>
<h1>Welcome!</h1>
<div class="header">
<p>No navigation.</p>
</div>
</body>
</html>
HTML
[200, {"Content-Type" => "text/html"}, [html]]
end
end
class TestMyRackApplication < Test::Unit::TestCase
include Capybara::DSL
def setup
Capybara.app = MyRackApplication.new
end
def test_title
visit("/")
within("h1") do
assert_equal("Welcome!", text)
end
end
def test_no_sidebar
visit("/")
within("body") do
assert_not_find(".sidebar")
end
end
def test_header_content
visit("/")
within(".header") do
find("ol.navi")
# This fails with the following message:
#
# <"ol.navi">(:css) expected to find an element in
# <<div class="header">
# <p>No navigation.</p>
# </div>>
#
# This messages shows the current context. You don't need to
# entire HTML. You just see the current context moved by "within".
# It helps you debug a problem without save_and_open_page.
end
end
attribute :js, true
def test_destroy_a_post
# JavaScript driver is used
visit("/")
page.accept_confirm do
click_on("Destroy", match: :first)
end
within(".alert") do
assert_equal("Post was successfully destroyed", text)
end
end
end
LGPLv2.1 or later.
(Kouhei Sutou has a right to change the license including contributed patches.)
FAQs
Unknown package
We found that test-unit-capybara demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.