repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/oidc_providers_test.rb
test/system/avo/oidc_providers_test.rb
require "application_system_test_case" class Avo::OIDCProvidersSystemTest < ApplicationSystemTestCase make_my_diffs_pretty! test "refreshing provider" do admin_user = create(:admin_github_user, :is_admin) avo_sign_in_as admin_user provider = create(:oidc_provider, issuer: "https://token.actions.githu...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/manual_changes_test.rb
test/system/avo/manual_changes_test.rb
require "application_system_test_case" class Avo::ManualChangesSystemTest < ApplicationSystemTestCase make_my_diffs_pretty! test "auditing changes" do admin_user = create(:admin_github_user, :is_admin) avo_sign_in_as admin_user Admin::LogTicketPolicy.any_instance.stubs(:avo_create?).returns(true) ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/web_hooks_test.rb
test/system/avo/web_hooks_test.rb
require "application_system_test_case" class Avo::WebHooksSystemTest < ApplicationSystemTestCase include ActiveJob::TestHelper test "delete webhook" do Minitest::Test.make_my_diffs_pretty! admin_user = create(:admin_github_user, :is_admin) avo_sign_in_as admin_user web_hook = create(:global_web_h...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/events_test.rb
test/system/avo/events_test.rb
require "application_system_test_case" class Avo::EventsSystemTest < ApplicationSystemTestCase make_my_diffs_pretty! include ActiveJob::TestHelper test "user events" do avo_sign_in_as(create(:admin_github_user, :is_admin)) visit avo.root_path click_link "Events user events" assert_selector "d...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/sendgrid_events_test.rb
test/system/avo/sendgrid_events_test.rb
require "application_system_test_case" class Avo::SendgridEventsSystemTest < ApplicationSystemTestCase include ActiveJob::TestHelper test "search for event" do user = FactoryBot.create(:admin_github_user, :is_admin) avo_sign_in_as(user) visit avo.resources_sendgrid_events_path event = FactoryBot...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/versions_test.rb
test/system/avo/versions_test.rb
require "application_system_test_case" class Avo::VersionsSystemTest < ApplicationSystemTestCase make_my_diffs_pretty! include ActiveJob::TestHelper setup do StoreVersionContentsJob.stubs(:perform_later) end test "restore a rubygem version" do admin_user = create(:admin_github_user, :is_admin) ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/users_test.rb
test/system/avo/users_test.rb
require "application_system_test_case" class Avo::UsersSystemTest < ApplicationSystemTestCase make_my_diffs_pretty! include ActiveJob::TestHelper test "reset mfa" do Minitest::Test.make_my_diffs_pretty! admin_user = create(:admin_github_user, :is_admin) avo_sign_in_as admin_user user = create(...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/system/avo/rubygems_test.rb
test/system/avo/rubygems_test.rb
require "application_system_test_case" class Avo::RubygemsSystemTest < ApplicationSystemTestCase make_my_diffs_pretty! include ActiveJob::TestHelper test "release reserved namespace" do admin_user = create(:admin_github_user, :is_admin) avo_sign_in_as admin_user rubygem = create(:rubygem, created_...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/email_confirmation_test.rb
test/integration/email_confirmation_test.rb
require "test_helper" require "helpers/email_helpers" class EmailConfirmationTest < SystemTest include ActiveJob::TestHelper setup do @user = create(:user) end def request_confirmation_mail(email) visit sign_in_path click_link "Didn't receive confirmation mail?" fill_in "Email address", with...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/session_test.rb
test/integration/session_test.rb
require "test_helper" class SessionTest < ActionDispatch::IntegrationTest def retrive_authenticity_token(path) get path assert_response :success request.session[:_csrf_token] end setup do create(:user, handle: "johndoe", password: PasswordHelpers::SECURE_TEST_PASSWORD) @last_session_token =...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/yank_test.rb
test/integration/yank_test.rb
require "test_helper" class YankTest < SystemTest setup do @user = create(:user, password: PasswordHelpers::SECURE_TEST_PASSWORD) @rubygem = create(:rubygem, name: "sandworm") create(:ownership, user: @user, rubygem: @rubygem) @user_api_key = "12345" create(:api_key, owner: @user, key: @user_api...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/gems_test.rb
test/integration/gems_test.rb
require "test_helper" class GemsTest < ActionDispatch::IntegrationTest setup do @user = create(:user) @rubygem = create(:rubygem, name: "sandworm", number: "1.0.0") end test "gem page with a non valid HTTP_ACCEPT header" do get rubygem_path(@rubygem.slug), headers: { "HTTP_ACCEPT" => "application/me...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/policies_test.rb
test/integration/policies_test.rb
require "test_helper" class PoliciesTest < SystemTest test "gracefully fails on unknown page" do assert_raises(ActionController::RoutingError) do visit "/policies/not-existing-one" end end test "it only allows html format" do assert_raises(ActionController::RoutingError) do visit "/polic...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avatars_test.rb
test/integration/avatars_test.rb
require "test_helper" class AvatarsTest < ActionDispatch::IntegrationTest test "returns 404 when no user is found" do get avatar_user_path("user", size: 64) assert_response :not_found end test "redirects to default avatar when gravatar returns 404" do stub_request(:get, Addressable::Template.new("h...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/subscriptions_test.rb
test/integration/subscriptions_test.rb
require "test_helper" class SubscriptionsTest < SystemTest setup do @user = create(:user) @rubygem = create(:rubygem, name: "sandworm", number: "1.0.0") @version = create(:version, rubygem: @rubygem, number: "1.1.1") end test "subscribe to a gem" do visit subscriptions_path(as: @user.id) as...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/encoding_test.rb
test/integration/encoding_test.rb
require "test_helper" class EncodingTest < ActionDispatch::IntegrationTest include SearchKickHelper test "invalid utf-8 characters should be sanitized" do import_and_refresh get "/api/v1/search.json?query=vagrant%ADvbguest" assert_response :success end test "gzip not supported" do get "/" ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/search_test.rb
test/integration/search_test.rb
require "test_helper" class SearchTest < SystemTest include SearchKickHelper test "searching for a gem" do create(:rubygem, name: "LDAP", number: "1.0.0") create(:rubygem, name: "LDAP-PLUS", number: "1.0.0") import_and_refresh visit search_path fill_in "query", with: "LDAP" click_button ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/owner_test.rb
test/integration/owner_test.rb
require "test_helper" class OwnerTest < SystemTest include ActiveJob::TestHelper include RubygemsHelper setup do @user = create(:user) @other_user = create(:user) @rubygem = create(:rubygem, number: "1.0.0") @ownership = create(:ownership, user: @user, rubygem: @rubygem) sign_in_as(@user) ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/sendgrid_webhook_test.rb
test/integration/sendgrid_webhook_test.rb
require "test_helper" class SendgridWebhookTest < ActionDispatch::IntegrationTest include ActiveJob::TestHelper test "responds 200 OK to valid credentials" do params = [ { sg_event_id: "nwlyJ3Ej3wUBZQiaCAL5YA==", timestamp: Time.current.to_i } ] post "/sendgrid_events", params: params, as: :json...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/organizations_test.rb
test/integration/organizations_test.rb
require "test_helper" class OrganizationsTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) end test "should show an organiza...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/push_test.rb
test/integration/push_test.rb
require "test_helper" class PushTest < ActionDispatch::IntegrationTest include ActiveJob::TestHelper setup do Dir.chdir(Dir.mktmpdir) @key = "12345" @user = create(:user) create(:api_key, owner: @user, key: @key, scopes: %i[push_rubygem]) stub_request(:get, "https://tuf-repo-cdn.sigstore.dev/...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/sign_up_test.rb
test/integration/sign_up_test.rb
require "test_helper" class SignUpTest < SystemTest test "sign up" do visit sign_up_path fill_in "Email", with: "email@person.com" fill_in "Username", with: "nick" fill_in "Password", with: PasswordHelpers::SECURE_TEST_PASSWORD click_button "Sign up" assert page.has_selector? "#flash_notice...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/routing_test.rb
test/integration/routing_test.rb
require "test_helper" class RoutingTest < ActionDispatch::IntegrationTest def contoller_in_ui?(controller) !controller.nil? && controller !~ %r{^api|internal|sendgrid_events.*|view_components(_system_test)?|turbo|admin/admin|avatars$} end setup do @prev_env = ENV["RAILS_ENV"] ENV["RAILS_ENV"] = "pro...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/notification_settings_test.rb
test/integration/notification_settings_test.rb
require "test_helper" require "capybara/minitest" class NotificationSettingsTest < SystemTest include Capybara::Minitest::Assertions test "changing email notification settings" do user = create(:user) rubygem1 = create(:rubygem, number: "0.0.1") rubygem2 = create(:rubygem, number: "0.0.2") ownersh...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/sign_in_test.rb
test/integration/sign_in_test.rb
require "test_helper" class SignInTest < SystemTest setup do @user = create(:user, email: "nick@example.com", password: PasswordHelpers::SECURE_TEST_PASSWORD, handle: nil) @mfa_user = create(:user, email: "john@example.com", password: PasswordHelpers::SECURE_TEST_PASSWORD, mfa_level: :ui_on...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/oauth_test.rb
test/integration/oauth_test.rb
require "test_helper" class OAuthTest < ActionDispatch::IntegrationTest setup do OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new({ provider: "github", uid: "95144751", info: { nickname: "jackson-keeling", em...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/feature_flag_integration_test.rb
test/integration/feature_flag_integration_test.rb
require "test_helper" class FeatureFlagIntegrationTest < ActiveSupport::TestCase def setup @user = create(:user) @service = FakeSearchService.new(@user) # Clean up all feature flags before each test Flipper.features.each(&:remove) end def teardown # Clean up after each test Flipper.feat...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/locale_test.rb
test/integration/locale_test.rb
require "test_helper" class LocaleTest < SystemTest test "html lang attribute is set from locale" do I18n.available_locales.each do |locale| visit root_path(locale: locale) assert_equal locale.to_s, page.find("html")[:lang] end end test "locale is switched via locale menu" do visit root...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/i18n_test.rb
test/integration/i18n_test.rb
require "test_helper" class I18nTest < ActionDispatch::IntegrationTest def collect_combined_keys(hash, namespace = nil) hash.collect do |k, v| keys = [] keys << collect_combined_keys(v, "#{namespace}.#{k}") if v.is_a?(Hash) keys << "#{namespace}.#{k}" end.flatten end test "translation ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/dashboard_test.rb
test/integration/dashboard_test.rb
require "test_helper" class DashboardTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) FeatureFlag.enable_for_actor(FeatureF...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/null_char_param_test.rb
test/integration/null_char_param_test.rb
require "test_helper" class NullCharParamTest < ActionDispatch::IntegrationTest test "params with null character respond with bad request" do get "/search?utf8=%E2%9C%93&query=php://input%00.&search_submit=%E2%8C%95" assert_response :bad_request end test "nested params with null character respond with ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/password_reset_test.rb
test/integration/password_reset_test.rb
require "test_helper" class PasswordResetTest < SystemTest include ActiveJob::TestHelper def password_reset_link body = ActionMailer::Base.deliveries.last.parts[1].body.decoded.to_s link = %r{http://localhost(?::\d+)?/password([^";]*)}.match(body) link[0] end setup do @user = create(:user, ha...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/rack_attack_test.rb
test/integration/rack_attack_test.rb
require "test_helper" require "helpers/rate_limit_helpers" class RackAttackTest < ActionDispatch::IntegrationTest include RateLimitHelpers setup do Rack::Attack.cache.store = ActiveSupport::Cache::MemoryStore.new Rails.cache.clear @ip_address = "1.2.3.4" @user = create(:user, email: "nick@example...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/rubygems_test.rb
test/integration/rubygems_test.rb
require "test_helper" class RubygemsTest < ActionDispatch::IntegrationTest setup do create_list(:rubygem, 20) # rubocop:disable FactoryBot/ExcessiveCreateList create(:rubygem, name: "arrakis", number: "1.0.0") end test "gems list shows pagination" do get "/gems" assert page.has_content? "arraki...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/page_params_test.rb
test/integration/page_params_test.rb
require "test_helper" class PageParamsTest < SystemTest include SearchKickHelper test "stats with page param more than 10" do visit stats_path(page: "11") assert redirect_to(stats_path(page: "1")) assert page.has_content? "Stats" assert page.has_content? "Page number is out of range. Redirected t...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/pages_test.rb
test/integration/pages_test.rb
require "test_helper" class PagesTest < SystemTest test "gracefully fails on unknown page" do assert_raises(ActionController::RoutingError) do visit "/pages/not-existing-one" end end test "it only allows html format" do assert_raises(ActionController::RoutingError) do visit "/pages/data....
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/organizations/gems_test.rb
test/integration/organizations/gems_test.rb
require "test_helper" class Organizations::GemsTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) end test "should get index"...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/organizations/members_test.rb
test/integration/organizations/members_test.rb
require "test_helper" class Organizations::MembersTest < ActionDispatch::IntegrationTest setup do @owner = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) @maintainer = create(:user) @organization = create(:organization) @owner_membership = create(:membership, user: @owner...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/audits_controller_test.rb
test/integration/avo/audits_controller_test.rb
require "test_helper" class Avo::AuditsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting audits as admin" do admin = create(:admin_github_user, :is_admin) admin_sign_in_as admin get avo.resources_audits_path assert_response :success user = create(:user) ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/webauthn_credentials_controller_test.rb
test/integration/avo/webauthn_credentials_controller_test.rb
require "test_helper" class Avo::WebauthnCredentialsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting webauthn credentials as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) webauthn_credential = create(:webauthn_credential) get avo.resources_webaut...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/link_verifications_controller_test.rb
test/integration/avo/link_verifications_controller_test.rb
require "test_helper" class Avo::LinkVerificationsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting link_verifications as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_link_verifications_path assert_response :success link_ve...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/oidc_api_key_roles_controller_test.rb
test/integration/avo/oidc_api_key_roles_controller_test.rb
require "test_helper" class Avo::OIDCApiKeyRolesControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting api key roles as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_oidc_api_key_roles_path assert_response :success oidc_api_key_r...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/oidc_providers_controller_test.rb
test/integration/avo/oidc_providers_controller_test.rb
require "test_helper" class Avo::OIDCProvidersControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting providers as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_oidc_providers_path assert_response :success oidc_provider = create(:...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/webauthn_verifications_controller_test.rb
test/integration/avo/webauthn_verifications_controller_test.rb
require "test_helper" class Avo::WebauthnVerificationsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting webauthn verifications as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) webauthn_verification = create(:webauthn_verification) get avo.resource...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/gem_name_reservations_controller_test.rb
test/integration/avo/gem_name_reservations_controller_test.rb
require "test_helper" class Avo::GemNameReservationsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting gem_downloads as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) create(:gem_name_reservation, name: "hello") get avo.resources_gem_name_reservation...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/linksets_test.rb
test/integration/avo/linksets_test.rb
require "test_helper" class Avo::LinksetTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting linksets as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_linksets_path assert_response :success linkset = create(:linkset) get avo.resourc...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/admin_github_users_test.rb
test/integration/avo/admin_github_users_test.rb
require "test_helper" class Avo::AdminGitHubUsersTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting admin github users as admin" do user = create(:admin_github_user, :is_admin) admin_sign_in_as user get avo.resources_admin_github_users_path assert_response :success ass...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/oidc_rubygem_trusted_publishers_controller_test.rb
test/integration/avo/oidc_rubygem_trusted_publishers_controller_test.rb
require "test_helper" class Avo::OIDCRubygemTrustedPublishersControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting rubygem trusted publishers as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_oidc_rubygem_trusted_publishers_path asser...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/log_tickets_controller_test.rb
test/integration/avo/log_tickets_controller_test.rb
require "test_helper" class Avo::LogTicketsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting log_tickets as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_log_tickets_path assert_response :success log_ticket = create(:log_tic...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/web_hooks_controller_test.rb
test/integration/avo/web_hooks_controller_test.rb
require "test_helper" class Avo::WebHooksControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting web_hooks as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_web_hooks_path assert_response :success web_hook = create(:web_hook) ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/attestations_controller_test.rb
test/integration/avo/attestations_controller_test.rb
require "test_helper" class Avo::AttestationsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting attestations as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_attestations_path assert_response :success attestation = create(:at...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/gem_downloads_controller_test.rb
test/integration/avo/gem_downloads_controller_test.rb
require "test_helper" class Avo::GemDownloadsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting gem_downloads as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_gem_downloads_path assert_response :success version = create(:vers...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/oidc_pending_trusted_publishers_controller_test.rb
test/integration/avo/oidc_pending_trusted_publishers_controller_test.rb
require "test_helper" class Avo::OIDCPendingTrustedPublishersControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting pending trusted publishers as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_oidc_pending_trusted_publishers_path asser...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/oidc_trusted_publisher_github_actions_controller_test.rb
test/integration/avo/oidc_trusted_publisher_github_actions_controller_test.rb
require "test_helper" class Avo::OIDCTrustedPublisherGitHubActionsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting github actions trusted publishers as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_oidc_trusted_publisher_github_actio...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/oidc_id_tokens_controller_test.rb
test/integration/avo/oidc_id_tokens_controller_test.rb
require "test_helper" class Avo::OIDCIdTokensControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting id tokens as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_oidc_id_tokens_path assert_response :success oidc_id_token = create(:o...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/users_test.rb
test/integration/avo/users_test.rb
require "test_helper" class Avo::UsersTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting users as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_users_path assert_response :success user = create(:user) get avo.resources_users_path ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/maintenance_task_runs_controller_test.rb
test/integration/avo/maintenance_task_runs_controller_test.rb
require "test_helper" class Avo::MaintenanceTaskRunsControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting runs as admin" do admin = create(:admin_github_user, :is_admin) admin_sign_in_as admin get avo.resources_maintenance_tasks_runs_path assert_response :success ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/rubygems_test.rb
test/integration/avo/rubygems_test.rb
require "test_helper" class Avo::RubygemsTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting rubygems as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_rubygems_path assert_response :success rubygem = create(:rubygem) get avo.resour...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/avo/deletion_controller_test.rb
test/integration/avo/deletion_controller_test.rb
require "test_helper" class Avo::DeletionControllerTest < ActionDispatch::IntegrationTest include AdminHelpers test "getting deletion as admin" do admin_sign_in_as create(:admin_github_user, :is_admin) get avo.resources_deletions_path assert_response :success deletion = create(:deletion) g...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/admin/good_job_test.rb
test/integration/admin/good_job_test.rb
require "test_helper" class Admin::GoodJobTest < ActionDispatch::IntegrationTest include AdminHelpers test "viewing good job admin dashboard" do get "/admin/good_job" assert_response :success page.assert_text "Log in with GitHub" admin = create(:admin_github_user, :is_admin) admin_sign_in_as...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/compact_index_test.rb
test/integration/api/compact_index_test.rb
require "tempfile" require "test_helper" class CompactIndexTest < ActionDispatch::IntegrationTest def etag(body) %("#{Digest::MD5.hexdigest(body)}") end def digest(body) Digest::SHA256.base64digest(body) end setup do @rubygem2 = create(:rubygem, name: "gemB") @version = create(:version, rub...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/search_test.rb
test/integration/api/v1/search_test.rb
require "test_helper" class Api::V1::Search < ActionDispatch::IntegrationTest include SearchKickHelper test "request with non-string query shows bad request" do import_and_refresh get "/api/v1/search.json?query[]=" assert_response :bad_request end end
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/owner_test.rb
test/integration/api/v1/owner_test.rb
require "test_helper" class Api::V1::OwnerTest < ActionDispatch::IntegrationTest setup do @user_api_key = "12323" @user = create(:api_key, key: @user_api_key, scopes: %i[add_owner remove_owner]).user @other_user_api_key = "12324" @other_user = create(:api_key, key: @other_user_api_key, scopes: %i[ad...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/github_secret_scanning_test.rb
test/integration/api/v1/github_secret_scanning_test.rb
require "test_helper" class Api::V1::GitHubSecretScanningTest < ActionDispatch::IntegrationTest HEADER_KEYID = "GITHUB-PUBLIC-KEY-IDENTIFIER".freeze HEADER_SIGNATURE = "GITHUB-PUBLIC-KEY-SIGNATURE".freeze DEPS_DEV_HEADER_KEYID = "DepsDev-Public-Key-Identifier".freeze DEPS_DEV_HEADER_SIGNATURE = "DepsDev-Publi...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/rubygems_test.rb
test/integration/api/v1/rubygems_test.rb
require "test_helper" class Api::V1::RubygemsTest < ActionDispatch::IntegrationTest setup do @key = "12345" @user = create(:user) create(:api_key, owner: @user, key: @key, scopes: %i[index_rubygems push_rubygem]) end test "request has remote addr present" do ip_address = "1.2.3.4" RackAttack...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/oidc/id_tokens_test.rb
test/integration/api/v1/oidc/id_tokens_test.rb
require "test_helper" class Api::V1::OIDC::IdTokensTest < ActionDispatch::IntegrationTest make_my_diffs_pretty! setup do @role = create(:oidc_api_key_role) @user = @role.user @id_token = create(:oidc_id_token, user: @user, api_key_role: @role) @user_api_key = "12323" @api_key = create(:api_ke...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/oidc/trusted_publisher_controller_test.rb
test/integration/api/v1/oidc/trusted_publisher_controller_test.rb
require "test_helper" class Api::V1::OIDC::TrustedPublisherControllerTest < ActionDispatch::IntegrationTest setup do @pkey = OpenSSL::PKey::RSA.generate(2048) create(:oidc_provider, issuer: OIDC::Provider::GITHUB_ACTIONS_ISSUER, pkey: @pkey) @claims = { "aud" => Gemcutter::HOST, "exp" => 1_6...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/oidc/providers_test.rb
test/integration/api/v1/oidc/providers_test.rb
require "test_helper" class Api::V1::OIDC::ProvidersTest < ActionDispatch::IntegrationTest make_my_diffs_pretty! setup do @providers = create_list(:oidc_provider, 3) @user = create(:user) @user_api_key = "12323" @api_key = create(:api_key, owner: @user, key: @user_api_key) end context "on GE...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/oidc/rubygem_trusted_publishers_controller_test.rb
test/integration/api/v1/oidc/rubygem_trusted_publishers_controller_test.rb
require "test_helper" class Api::V1::OIDC::RubygemTrustedPublishersControllerTest < ActionDispatch::IntegrationTest make_my_diffs_pretty! setup do create(:oidc_provider, issuer: OIDC::Provider::GITHUB_ACTIONS_ISSUER) end context "without an API key" do context "on GET to index" do setup do ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v1/oidc/api_key_roles_test.rb
test/integration/api/v1/oidc/api_key_roles_test.rb
require "test_helper" class Api::V1::OIDC::ApiKeyRolesTest < ActionDispatch::IntegrationTest make_my_diffs_pretty! context "on GET to index" do setup do @role = create(:oidc_api_key_role) @user = @role.user @user_api_key = "12323" @api_key = create(:api_key, owner: @user, key: @user_ap...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/api/v2/version_information_test.rb
test/integration/api/v2/version_information_test.rb
require "test_helper" class VersionInformationTest < ActionDispatch::IntegrationTest setup do @rubygem = create(:rubygem) create(:version, rubygem: @rubygem, number: "2.0.0") end def request_endpoint(rubygem, version, format = "json") get api_v2_rubygem_version_path(rubygem.slug, version, format: fo...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/oidc/id_tokens_controller_test.rb
test/integration/oidc/id_tokens_controller_test.rb
require "test_helper" class OIDC::IdTokensControllerTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) @id_token = create(:oi...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/oidc/pending_trusted_publishers_controller_test.rb
test/integration/oidc/pending_trusted_publishers_controller_test.rb
require "test_helper" class OIDC::PendingTrustedPublishersControllerTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) @trust...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/oidc/providers_controller_test.rb
test/integration/oidc/providers_controller_test.rb
require "test_helper" class OIDC::ProvidersControllerTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) @id_token = create(:o...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/oidc/rubygem_trusted_publishers_controller_test.rb
test/integration/oidc/rubygem_trusted_publishers_controller_test.rb
require "test_helper" class OIDC::RubygemTrustedPublishersControllerTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) @rubyg...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/integration/oidc/api_key_roles_controller_test.rb
test/integration/oidc/api_key_roles_controller_test.rb
require "test_helper" class OIDC::ApiKeyRolesControllerIntegrationTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) post session_path(session: { who: @user.handle, password: PasswordHelpers::SECURE_TEST_PASSWORD }) @id_toke...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/api_policy_helpers.rb
test/helpers/api_policy_helpers.rb
require_relative "policy_helpers" module ApiPolicyHelpers extend ActiveSupport::Concern include PolicyHelpers class_methods do def should_require_scope(scope, action) context "requires #{scope} scope" do should "deny ApiKey without scope" do refute_authorized key_without_scope(scope)...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/es_helper.rb
test/helpers/es_helper.rb
module SearchKickHelper def import_and_refresh Rubygem.searchkick_reindex # wait for indexing to finish Searchkick.client.cluster.health wait_for_status: "yellow" end def es_downloads(id) response = get_response(id) response["_source"]["downloads"] end def es_version_downloads(id) r...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/gem_helpers.rb
test/helpers/gem_helpers.rb
module GemHelpers def gem_specification_from_gem_fixture(name) Gem::Package.new(File.join("test", "gems", "#{name}.gem")).spec end def gem_file(name = "test-0.0.0.gem", &) Rails.root.join("test", "gems", name.to_s).open("rb", &) end def build_gemspec(gemspec) Gem::DefaultUserInteraction.use_ui(G...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/admin_helpers.rb
test/helpers/admin_helpers.rb
module AdminHelpers extend ActiveSupport::Concern included do def admin_sign_in_as(admin_user) cookie_jar = ActionDispatch::Request.new(Rails.application.env_config.deep_dup).cookie_jar cookie_jar.encrypted["rubygems_admin_oauth_github_user"] = admin_user.id cookies["rubygems_admin_oauth_gith...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/feature_flag_helpers.rb
test/helpers/feature_flag_helpers.rb
module FeatureFlagHelpers def enable_feature(flag_name, actor: nil) if actor FeatureFlag.enable_for_actor(flag_name, actor) else FeatureFlag.enable_globally(flag_name) end end def disable_feature(flag_name) FeatureFlag.disable_globally(flag_name) end def with_feature(flag_name, e...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/oauth_helpers.rb
test/helpers/oauth_helpers.rb
module OauthHelpers def stub_github_info_request(info_data) stub_request(:post, "https://api.github.com/graphql") .with(body: { query: GitHubOAuthable::INFO_QUERY, variables: { organization_name: "rubygems" } }.to_json) .to_return( status: 200, headers: { "Content-Type" => "application...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/avo_helpers.rb
test/helpers/avo_helpers.rb
module AvoHelpers def avo_sign_in_as(user) OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new( provider: "github", uid: "1", credentials: { token: user.oauth_token, expires: false }, info: { name: user.login } ) @ip_address = create(:ip...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/rake_task_helper.rb
test/helpers/rake_task_helper.rb
require "rake" # Run Rake tasks without loading them and introducing constant redefinition warnings module RakeTaskHelper def setup_rake_tasks(task_file) Rake::Task.clear # :environment is already loaded when running tests, so stub it Rake::Task.define_task(:environment) load Rails.root.join("lib", "...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/webauthn_helpers.rb
test/helpers/webauthn_helpers.rb
module WebauthnHelpers def self.create_result(client:, challenge: nil) rp_id = URI.parse(client.origin).host challenge = if challenge Base64.urlsafe_decode64(challenge) else SecureRandom.random_bytes(32) end result = client.create( challenge: challenge, rp_id...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/password_helpers.rb
test/helpers/password_helpers.rb
module PasswordHelpers SECURE_TEST_PASSWORD = "?98,TUESDAY,SHOWN,exactly,56?".freeze end
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/policy_helpers.rb
test/helpers/policy_helpers.rb
module PolicyHelpers extend ActiveSupport::Concern def assert_authorized(policy_or_actor, action) policy = policy_or_actor if policy_or_actor.is_a?(ApplicationPolicy) policy ||= policy!(policy_or_actor) result = policy.send(action) flunk "Expected #{policy.class} to authorize #{action.inspect}\n#{...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/email_helpers.rb
test/helpers/email_helpers.rb
module EmailHelpers def last_email_link perform_enqueued_jobs only: ActionMailer::MailDeliveryJob confirmation_link end def last_email ActionMailer::Base.deliveries.last end def mails_count ActionMailer::Base.deliveries.size end def confirmation_link refute_empty ActionMailer::Base....
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/helpers/rate_limit_helpers.rb
test/helpers/rate_limit_helpers.rb
module RateLimitHelpers def exceeding_limit (Rack::Attack::REQUEST_LIMIT * 1.25).to_i end def exceeding_email_limit (Rack::Attack::REQUEST_LIMIT_PER_EMAIL * 1.25).to_i end def exceeding_exp_base_limit (Rack::Attack::EXP_BASE_REQUEST_LIMIT * 1.25).to_i end def under_limit (Rack::Attack::...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/organization_policy_test.rb
test/policies/organization_policy_test.rb
require "test_helper" class OrganizationPolicyTest < PolicyTestCase setup do @owner = create(:user, handle: "owner") @admin = create(:user, handle: "admin") @maintainer = create(:user, handle: "maintainer") @guest = create(:user) @organization = create(:organization, owners: [@owner], admins: [@ad...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/rubygem_policy_test.rb
test/policies/rubygem_policy_test.rb
require "test_helper" class RubygemPolicyTest < PolicyTestCase setup do @owner = create(:user, handle: "owner") @maintainer = create(:user, handle: "maintainer") @rubygem = create(:rubygem, owners: [@owner], maintainers: [@maintainer]) @org_owner = create(:user, handle: "org_owner") @org_admin =...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/rubygem_trusted_publishing_policy_test.rb
test/policies/rubygem_trusted_publishing_policy_test.rb
require "test_helper" class RubygemTrustedPublishingPolicyTest < PolicyTestCase setup do @owner = create(:user, handle: "owner") @maintainer = create(:user, handle: "maintainer") @user = create(:user, handle: "user") @rubygem = create(:rubygem, owners: [@owner], maintainers: [@maintainer]) @rubyg...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/membership_policy_test.rb
test/policies/membership_policy_test.rb
require "test_helper" class MembershipPolicyTest < PolicyTestCase setup do @owner = create(:user, handle: "owner") @admin = create(:user, handle: "admin") @maintainer = create(:user, handle: "maintainer") @guest = create(:user) @organization = create(:organization, owners: [@owner], admins: [@admi...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/ownership_policy_test.rb
test/policies/ownership_policy_test.rb
require "test_helper" class OwnershipPolicyTest < ActiveSupport::TestCase setup do @authorizer = FactoryBot.create(:user, handle: "owner") @maintainer = FactoryBot.create(:user, handle: "maintainer") @rubygem = FactoryBot.create(:rubygem, owners: [@authorizer], maintainers: [@maintainer]) @authorizer...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/admin/audit_policy_test.rb
test/policies/admin/audit_policy_test.rb
require "test_helper" class Admin::AuditPolicyTest < AdminPolicyTestCase setup do @audit = create(:audit) @admin = create(:admin_github_user, :is_admin) @non_admin = create(:admin_github_user) end def test_scope assert_equal [@audit], policy_scope!( @admin, Audit ).to_a asse...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/admin/webauthn_verification_policy_test.rb
test/policies/admin/webauthn_verification_policy_test.rb
require "test_helper" class Admin::WebauthnVerificationPolicyTest < AdminPolicyTestCase setup do @webauthn_verification = FactoryBot.create(:webauthn_verification) @admin = FactoryBot.create(:admin_github_user, :is_admin) @non_admin = FactoryBot.create(:admin_github_user) end def test_scope asse...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/admin/deletion_policy_test.rb
test/policies/admin/deletion_policy_test.rb
require "test_helper" class Admin::DeletionPolicyTest < AdminPolicyTestCase setup do @version = create(:version) @deletion = Deletion.create!(version: @version, user: create(:user)) @admin = create(:admin_github_user, :is_admin) @non_admin = create(:admin_github_user) end def test_associations ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/admin/webauthn_credential_policy_test.rb
test/policies/admin/webauthn_credential_policy_test.rb
require "test_helper" class Admin::WebauthnCredentialPolicyTest < AdminPolicyTestCase setup do @webauthn_credential = FactoryBot.create(:webauthn_credential) @admin = FactoryBot.create(:admin_github_user, :is_admin) @non_admin = FactoryBot.create(:admin_github_user) end def test_scope assert_equ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/admin/organization_policy_test.rb
test/policies/admin/organization_policy_test.rb
require "test_helper" class Admin::OrganizationPolicyTest < AdminPolicyTestCase setup do @organization = FactoryBot.create(:organization) @admin = FactoryBot.create(:admin_github_user, :is_admin) @non_admin = FactoryBot.create(:admin_github_user) end def test_scope assert_equal [@organization], ...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false
rubygems/rubygems.org
https://github.com/rubygems/rubygems.org/blob/2b4f35acb8b13a47b00b24519359431f54aae073/test/policies/admin/api_key_rubygem_scope_policy_test.rb
test/policies/admin/api_key_rubygem_scope_policy_test.rb
require "test_helper" class Admin::ApiKeyRubygemScopePolicyTest < AdminPolicyTestCase setup do @scope = FactoryBot.create(:api_key_rubygem_scope) @admin = FactoryBot.create(:admin_github_user, :is_admin) @non_admin = FactoryBot.create(:admin_github_user) end def test_scope assert_equal [@scope],...
ruby
MIT
2b4f35acb8b13a47b00b24519359431f54aae073
2026-01-04T15:55:47.223680Z
false