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 |
|---|---|---|---|---|---|---|---|---|
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/errors_spec.rb | spec/system/errors_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "custom error handler page" do
describe "with custom handler setup" do
around do |example|
Rails.application.config.consider_all_requests_local = false
Rails.application.config.action_dispatch.show_exceptions = true
Rails.env = Acti... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/teams_spec.rb | spec/system/teams_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Teams support", type: :system, js: true do
let!(:registry) { create(:registry) }
let!(:admin) { create(:admin) }
let!(:another_user) { create(:user) }
let!(:team) { create(:team, owners: [admin]) }
let!(:team2) { create(:team, owners: [another_u... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/auth/login_feature_spec.rb | spec/system/auth/login_feature_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Login feature" do
let!(:registry) { create(:registry) }
let!(:user) { create(:user) }
before do
visit new_user_session_path
end
it "does not show any flash when accessing for the first time" do
visit root_path
expect(page).not_to h... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/auth/signup_feature_spec.rb | spec/system/auth/signup_feature_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Signup feature" do
before do
create(:admin)
APP_CONFIG["first_user_admin"] = { "enabled" => true }
APP_CONFIG["signup"] = { "enabled" => true }
visit new_user_registration_url
end
let!(:registry) { create(:registry) }
le... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/auth/logout_feature_spec.rb | spec/system/auth/logout_feature_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Logout feature", type: :system, js: true do
let!(:registry) { create(:registry) }
let!(:user) { create(:user) }
before do
login_as user
visit authenticated_root_path
end
it "Redirects to login screen" do
expect(page).to have_css("#... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/auth/profile_feature_spec.rb | spec/system/auth/profile_feature_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Update password feature" do
let!(:user) { create(:admin) }
before do
login_as user, scope: :user
visit edit_user_registration_path
end
# Changing the email
it "enables the button if the user pressed a key", js: true do
# Change th... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/auth/omniauth_registrations_spec.rb | spec/system/auth/omniauth_registrations_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe Auth::OmniauthRegistrationsController do
context "without omniauth session variable setting," do
it "GET #new redirect to /users/sign_in" do
visit users_oauth_url
expect(page).to have_current_path(new_user_session_path)
end
it "r... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/admin/users_spec.rb | spec/system/admin/users_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Admin - Users panel", type: :system, js: true do
let!(:registry) { create(:registry) }
let!(:admin) { create(:admin) }
let!(:user) { create(:user) }
before do
login_as admin
visit admin_users_path
end
describe "create users" do
i... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/system/admin/registries_spec.rb | spec/system/admin/registries_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Admin - Registries panel" do
let!(:admin) { create(:admin) }
before do
login_as admin
end
describe "#force_registry_config!" do
it "redirects to new_admin_registry_path if no registry has been configured" do
visit authenticated_roo... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/teams/migration_service_spec.rb | spec/services/teams/migration_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Teams::MigrationService" do
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:user) { create(:admin) }
let!(:team) { create(:team, owners: [user]) }
let!(:new_team) { create(:team, owners: [user]) }
let!(... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/teams/destroy_service_spec.rb | spec/services/teams/destroy_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Teams::DestroyService" do
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:user) { create(:admin) }
let!(:team) { create(:team, owners: [user]) }
let!(:new_team) { create(:team, owners: [user]) }
let!(:n... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/teams/create_service_spec.rb | spec/services/teams/create_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Teams::CreateService" do
let!(:admin) { create(:admin) }
let!(:user) { create(:user) }
let!(:new_owner) { create(:user) }
describe "#execute" do
context "with params current user as owner" do
subject(:service) { Teams::CreateService.new... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/tags/destroy_service_spec.rb | spec/services/tags/destroy_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Tags::DestroyService" do
let!(:user) { create(:admin) }
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:repository) { create(:repository, namespace: registry.global_namespace, name: "repo") }
let!(:tag) { ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/team_users/build_service_spec.rb | spec/services/team_users/build_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "TeamUsers::BuildService" do
let!(:user) { create(:user) }
let!(:team) { create(:team, owners: [user]) }
describe "#execute" do
context "with valid params" do
it "builds a new team user object" do
service = TeamUsers::BuildService.... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/team_users/update_service_spec.rb | spec/services/team_users/update_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "TeamUsers::UpdateService" do
let!(:user) { create(:user) }
let!(:admin) { create(:admin) }
let!(:owner) { create(:user) }
let!(:contributor) { create(:user) }
let!(:team) { create(:team, owners: [owner], contributors: [contributor]) }
describ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/team_users/destroy_service_spec.rb | spec/services/team_users/destroy_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "TeamUsers::DestroyService" do
let!(:user) { create(:user) }
let!(:owner) { create(:user) }
let!(:contributor) { create(:user) }
let!(:team) { create(:team, owners: [owner], contributors: [contributor]) }
describe "#execute" do
context "with... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/team_users/create_service_spec.rb | spec/services/team_users/create_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "TeamUsers::CreateService" do
let!(:user) { create(:user) }
let!(:owner) { create(:user) }
let!(:team) { create(:team, owners: [owner]) }
let!(:team_user) do
TeamUsers::BuildService.new(user, id: team.id, user: user.username, role: "viewer").ex... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/namespaces/build_service_spec.rb | spec/services/namespaces/build_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Namespaces::CreateService" do
let!(:user) { create(:user) }
let!(:team) { create(:team, owners: [user]) }
describe "#execute" do
context "with valid params" do
subject(:service) { Namespaces::BuildService.new(user, name: "name", team: tea... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/namespaces/destroy_service_spec.rb | spec/services/namespaces/destroy_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Namespaces::DestroyService" do
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:user) { create(:admin) }
let!(:team) { create(:team, owners: [user]) }
let!(:namespace) { create(:namespace, team: team, regis... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/namespaces/create_service_spec.rb | spec/services/namespaces/create_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Namespaces::CreateService" do
let!(:user) { create(:user) }
let!(:team) { create(:team, owners: [user]) }
let!(:registry) { create(:registry) }
let!(:namespace) do
Namespaces::BuildService.new(user, name: "name", team: team.name).execute
end... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/repositories/update_service_spec.rb | spec/services/repositories/update_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Repositories::UpdateService" do
let!(:user) { create(:user) }
let!(:admin) { create(:admin) }
let!(:public_namespace) do
create(:namespace,
visibility: Namespace.visibilities[:visibility_public],
team: create(:team))
... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/repositories/destroy_service_spec.rb | spec/services/repositories/destroy_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Repositories::DestroyService" do
let!(:user) { create(:admin) }
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:repository) { create(:repository, namespace: registry.global_namespace, name: "repo") }
describe "#... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/registries/validate_service_spec.rb | spec/services/registries/validate_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe "Registries::ValidateService" do
describe "#execute" do
context "invalid without only param" do
subject(:service) { Registries::ValidateService.new }
before do
allow_any_instance_of(Registry).to receive(:reachable?).and_return("E... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/services/registries/create_service_spec.rb | spec/services/registries/create_service_spec.rb | # frozen_string_literal: true
require "rails_helper"
# It creates a registry (by force so reachability is not checked) by using the
# create service. It accepts a boolean parameter: set it to true if you want the
# `persisted?` to be mocked (returning false).
def create_registry_with_service(should_mock)
allow_any_... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/devise.rb | spec/support/devise.rb | # frozen_string_literal: true
# Setup devise for tests.
RSpec.configure do |config|
config.include Devise::Test::ControllerHelpers, type: :controller
config.include Devise::Test::ControllerHelpers, type: :helper
config.include Devise::Test::ControllerHelpers, type: :view
config.include Devise::Test::Integratio... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/registry_events.rb | spec/support/registry_events.rb | # frozen_string_literal: true
module Portus
module Fixtures
# Shared fixture data dealing with registry events.
module RegistryEvent
SHA = "sha256:b9c8a3839b2754e0fc4309e0f994f617d43814996805388e2f9d977db3fa7967"
BODY =
{
"events" => [
{ "action" => "push" },
... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/database_cleaner.rb | spec/support/database_cleaner.rb | # frozen_string_literal: true
require "database_cleaner"
# DatabaseCleaner has been configured like this:
#
# - The database gets truncated before starting the test suite.
# - The cleaning strategy for the tests is by transaction, but tests dealing
# with the UI have to go with truncation. This is a requireme... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/helpers.rb | spec/support/helpers.rb | # frozen_string_literal: true
# A simple module containing some helper methods for acceptance tests.
module Helpers
# Login the given user and visit the root url.
def login(user)
login_as user, scope: :user
visit root_url
end
# Returns a String containing the id of the currently active element.
def ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/connection.rb | spec/support/connection.rb | # frozen_string_literal: true
# HACK: PostgreSQL has exactly one test failing randomly because of a
# `PG::ConnectionBad` exception. We've tried several alternatives but none of
# them worked. So, instead, this piece of code will try the connection up again
# whenever this exception is catched on the `reconnect!` meth... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/wait_for_events.rb | spec/support/wait_for_events.rb | # frozen_string_literal: true
# Theoretically, Capybara is clever enough to wait for asynchronous events to
# happen (e.g. AJAX). Sadly, this is not always true. For more, read:
#
# https://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara
#
# Therefore, we add some methods for waiting that will be use... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/containers.rb | spec/support/containers.rb | # frozen_string_literal: true
# Module related to container's helpers stuff
module Containers
# Checks whether it's running inside of a Docker container or not
def self.dockerized?
@dockerized ||= File.read("/proc/1/cgroup").include?("docker")
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/support/models/registry_raw_event.rb | spec/support/models/registry_raw_event.rb | # frozen_string_literal: true
class RegistryRawEvent
attr_accessor :action, :target, :request, :actor
def to_test_hash
{
"action" => action,
"target" => target,
"request" => request,
"actor" => actor
}.deep_dup
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/wait_ldap_check.rb | spec/integration/helpers/wait_ldap_check.rb | # frozen_string_literal: true
require_relative "waiter"
# This runner waits until the LDAP background task has performed a check.
class LDAPCheckWaiter < ::Integration::Helpers::Waiter
def initialize(sleep_time, timeout, resource)
super(sleep_time, timeout)
@resource = resource
end
# Returns true when... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/curl.rb | spec/integration/helpers/curl.rb | # frozen_string_literal: true
require "net/http"
require "uri"
##
# What we expect from the environment and from passed parameters.
hostname = ENV["PORTUS_MACHINE_FQDN_VALUE"]
method = ARGV[0].downcase
endpoint = ARGV[1]
username = ARGV[2]
parameters = ARGV[3]
##
# We can have an :id parameter, let's gues... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/delete.rb | spec/integration/helpers/delete.rb | # frozen_string_literal: true
# It accepts exactly two arguments: the repository name (full name) and the tag
# name. With these two things, it will simply issue a delete request to the
# Registry.
require "portus/registry_client"
REPOSITORY = ARGV.first.dup
TAG = ARGV.last.dup
RegistryEvent.all.destroy_all
... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/waiter.rb | spec/integration/helpers/waiter.rb | # frozen_string_literal: true
# Integration is the module that encapsulates all the utilities for integration
# tests.
module Integration
# Helpers contains helper classes for integration tests.
module Helpers
# Waiter implements a simple loop with a given timeout and a sleep
# time. This class is meant to... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/wait_event_done.rb | spec/integration/helpers/wait_event_done.rb | # frozen_string_literal: true
require "json"
require_relative "waiter"
# This runner waits until a registry event related to the given tag (first
# argument) is marked as done by the background process. This runner will
# timeout if it takes just too long. Last but not least, you can pass a final
# argument with the ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/ldap.rb | spec/integration/helpers/ldap.rb | # frozen_string_literal: true
require "portus/ldap/authenticatable"
##
# Define a class that mocks stuff like `params` and exit methods.
class IntegrationLDAP < Portus::LDAP::Authenticatable
attr_reader :params
attr_accessor :session
def initialize(params)
@params = { user: params }
@session = {}
e... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/helpers/eval.rb | spec/integration/helpers/eval.rb | # frozen_string_literal: true
# Outputs the evaluated object from the first argument.
# rubocop:disable Security/Eval
puts eval(ARGV.first)
# rubocop:enable Security/Eval
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/profiles/minimal.rb | spec/integration/profiles/minimal.rb | # frozen_string_literal: true
require_relative "shared"
clean_db!
create_registry!
User.create!(
username: "admin",
password: "12341234",
email: "admin@example.local",
admin: true
)
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/profiles/full.rb | spec/integration/profiles/full.rb | # frozen_string_literal: true
require_relative "shared"
clean_db!
create_registry!
admin = User.create!(
username: "admin",
password: "12341234",
email: "admin@example.local",
admin: true
)
contributor = User.create!(
username: "user",
password: "12341234",
email: "user@example.local",
admi... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/profiles/ldap.rb | spec/integration/profiles/ldap.rb | # frozen_string_literal: true
require "net/ldap"
require_relative "shared"
clean_db!
create_registry!
##
# Create bot and DB user.
User.create!(
username: "pfabra",
password: "giecftw1918",
email: "pfabra@iec.cat",
bot: true
)
User.create!(username: "noller", password: "lapapallona", email: "noller@... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/integration/profiles/shared.rb | spec/integration/profiles/shared.rb | # frozen_string_literal: true
# It truncates the DB. Use this always on profiles.
def clean_db!
ActiveRecord::Base.establish_connection
ActiveRecord::Base.connection.execute("SET FOREIGN_KEY_CHECKS = 0")
ActiveRecord::Base.connection.data_sources.each do |table|
next if table == "schema_migrations"
Acti... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/routing/repositories_routing_spec.rb | spec/routing/repositories_routing_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: repositories
#
# id :integer not null, primary key
# name :string(255) default(""), not null
# namespace_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# marked ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/routing/namespaces_routing_spec.rb | spec/routing/namespaces_routing_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: namespaces
#
# id :integer not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# team_id :integer
# registry_id :integer not null
# ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/help_controller_spec.rb | spec/requests/help_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe HelpController do
describe "GET #index" do
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:user) { create(:admin) }
before do
sign_in user
end
it "returns the page successfully" do
get ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/namespaces_controller_spec.rb | spec/requests/namespaces_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe NamespacesController do
let(:registry) { create(:registry) }
let(:user) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:owner) { create(:user) }
let(:admin) { create(:user, admin: true) }
let(:team) d... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/errors_controller_spec.rb | spec/requests/errors_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe ErrorsController do
describe "the fixes params is set" do
context "development" do
before :all do
secrets = Rails.application.secrets
@secret_key_base = secrets.secret_key_base
@secret_machine_fqdn = APP_CONFIG["machine_... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/search_controller_spec.rb | spec/requests/search_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe SearchController do
let(:registry) { create(:registry) }
let(:user) { create(:user) }
let(:team) { create(:team, owners: [user]) }
before do
sign_in user
namespace = create(:namespace, team: team, registry: registry... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/tags_controller_spec.rb | spec/requests/tags_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe TagsController do
describe "GET #show" do
let!(:registry) { create(:registry, hostname: "registry.test.lan") }
let!(:user) { create(:admin) }
let!(:repository) { create(:repository, namespace: registry.global_namespace, name:... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/webhook_headers_controller_spec.rb | spec/requests/webhook_headers_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe WebhookHeadersController do
let!(:registry) { create(:registry) }
let(:user) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:owner) { create(:user) }
let(:team) do
create(:team,
own... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/explore_controller_spec.rb | spec/requests/explore_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ExploreController do
describe "GET #index" do
it "returns http success" do
APP_CONFIG["anonymous_browsing"] = { "enabled" => true }
get explore_index_url
expect(response).to have_http_status(:success)
end
it "redirec... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/repositories_controller_spec.rb | spec/requests/repositories_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe RepositoriesController do
let(:user) { create(:user) }
let!(:public_namespace) do
create(:namespace,
visibility: Namespace.visibilities[:visibility_public],
team: create(:team))
end
let!(:visible_repository) { create... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/teams_controller_spec.rb | spec/requests/teams_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe TeamsController do
let(:valid_attributes) do
{ name: "qa team", description: "short test description" }
end
let(:invalid_attributes) do
{ admin: "not valid" }
end
# TODO: (mssola) re-factor this so the team is always created. I've... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/passwords_controller_spec.rb | spec/requests/passwords_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe PasswordsController do
before do
APP_CONFIG["email"] = {
"name" => "Portus",
"from" => "portus@example.com",
"reply_to" => "noreply@example.com"
}
@user = create(:admin)
@raw = @user.send_reset_password_instruc... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/webhooks_controller_spec.rb | spec/requests/webhooks_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe WebhooksController do
let!(:registry) { create(:registry) }
let(:user) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:owner) { create(:user) }
let(:team) do
create(:team,
owners: ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/comments_controller_spec.rb | spec/requests/comments_controller_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: comments
#
# id :integer not null, primary key
# body :text(65535)
# repository_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer
#
# Indexes... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/webhook_deliveries_controller_spec.rb | spec/requests/webhook_deliveries_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe WebhookDeliveriesController do
let!(:registry) { create(:registry) }
let!(:owner) { create(:user) }
let!(:team) { create(:team, owners: [owner]) }
let!(:namespace) { create(:namespace, team: team, registr... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/dashboard_controller_spec.rb | spec/requests/dashboard_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe DashboardController do
let(:user) { create(:user) }
before do
create(:registry)
sign_in user
end
describe "GET #index" do
it "returns http success" do
get authenticated_root_url
expect(response).to have_http_status(:... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/auth/registrations_controller_spec.rb | spec/requests/auth/registrations_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe Auth::RegistrationsController do
describe "POST #create" do
before do
APP_CONFIG["signup"] = { "enabled" => true }
end
it "defaults admin to false when omitted" do
post user_registration_url, params: { user: {
"username" ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/admin/users_controller_spec.rb | spec/requests/admin/users_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe Admin::UsersController do
let(:admin) { create(:admin) }
let(:user) { create(:user) }
context "as admin user" do
before do
create(:registry)
sign_in admin
end
describe "GET #index" do
it "returns http success" do... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/admin/registries_controller_spec.rb | spec/requests/admin/registries_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe Admin::RegistriesController do
let(:admin) { create(:admin) }
before do
sign_in admin
end
describe "GET #new" do
it "returns http success" do
get new_admin_registry_url
expect(response).to have_http_status(:success)
... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/admin/activities_controller_spec.rb | spec/requests/admin/activities_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe Admin::ActivitiesController do
let(:admin) { create(:admin) }
before do
sign_in admin
end
describe "GET #index" do
before do
create(:registry)
end
it "paginates activities" do
get admin_activities_url
expe... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/requests/api/v2/ping_controller_spec.rb | spec/requests/api/v2/ping_controller_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe Api::V2::PingController do
describe "#ping" do
context "user authorized" do
it "responds with 200" do
sign_in(create(:user))
get v2_ping_url
expect(response.status).to eq 200
end
end
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/namespaces_helper_spec.rb | spec/helpers/namespaces_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe NamespacesHelper, type: :helper do
describe "known activity" do
let!(:registry) { create(:registry) }
let!(:user) { create(:admin) }
let!(:team) { create(:team, owners: [user]) }
let!(:namespace) do
Namespaces::BuildSe... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/registries_helper_spec.rb | spec/helpers/registries_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe RegistriesHelper, type: :helper do
let!(:registry) { create(:registry) }
describe "#registry_status_icon" do
it "renders with chain icon if reachable" do
allow(registry).to receive(:reachable?).and_return("")
html = helper.regis... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/search_helper_spec.rb | spec/helpers/search_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe SearchHelper, type: :helper do
describe "build_search_category_url" do
it "returns true if current user is an owner of the team" do
expected = "#{search_index_path}?utf8=✓&search=&type=repositories"
params = { utf8: "✓", search: "" ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/application_helper_spec.rb | spec/helpers/application_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ApplicationHelper, type: :helper do
describe "#user_image_tag" do
let(:user) { create(:user, email: "user@example.com") }
it "uses the fa icon if gravatar support is disabled" do
expect(user_image_tag(user)).to eq(
'<i class=... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/sessions_helper_spec.rb | spec/helpers/sessions_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe SessionsHelper, type: :helper do
describe "#social_login" do
it "display social buttons" do
APP_CONFIG["oauth"] = { "google_oauth2" => { "enabled" => true } }
expect(helper.social_login).to match(/Social logins/)
end
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/teams_helper_spec.rb | spec/helpers/teams_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe TeamsHelper, type: :helper do
let(:admin) { create(:admin) }
let(:owner) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:team) do
create(:team,
owners: [owner],... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/repositories_helper_spec.rb | spec/helpers/repositories_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
# Just opens up protected methods so they can be used in the test suite.
class SyncMock < ::Portus::Background::Sync
def update_registry!(catalog)
super
end
end
RSpec.describe RepositoriesHelper, type: :helper do
include NamespacesHelper
describe "#re... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/helpers/activities_helper_spec.rb | spec/helpers/activities_helper_spec.rb | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ActivitiesHelper, type: :helper do
let(:user) { create(:user, email: "user@example.com") }
let(:team) { create(:team) }
describe "#activity_owner" do
it "returns the proper activity owner" do
activity = team.create_activity :create, ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/repository_policy_spec.rb | spec/policies/repository_policy_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe RepositoryPolicy do
subject { described_class }
let(:registry) { create(:registry) }
let(:user) { create(:user) }
let(:user2) { create(:user) }
let(:team) { create(:team, owners: [user]) }
let(:team2) { create(:tea... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/team_user_policy_spec.rb | spec/policies/team_user_policy_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe TeamUserPolicy do
subject { described_class }
let(:admin) { create(:admin) }
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:team) do
... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/webhook_policy_spec.rb | spec/policies/webhook_policy_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe WebhookPolicy do
subject { described_class }
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:team) do
create(:team,
owners: ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/team_policy_spec.rb | spec/policies/team_policy_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe TeamPolicy do
subject { described_class }
let(:admin) { create(:admin) }
let(:owner) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:team) do
create(:team,
owners: [owner... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/namespace_policy_spec.rb | spec/policies/namespace_policy_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe NamespacePolicy do
subject { described_class }
let!(:registry) { create(:registry) }
let(:admin) { create(:admin) }
let(:user) { create(:user) }
let(:owner) { create(:user) }
let(:viewer) { create(:user) }
let(:cont... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/registry_policy_spec.rb | spec/policies/registry_policy_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe RegistryPolicy do
subject { described_class }
let(:user) { create(:user) }
let(:admin) { create(:admin) }
permissions :all? do
it "allows access to admin users" do
expect(subject).to permit(admin, nil)
end
it "does not allow ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/policies/public_activity/activity_policy_spec.rb | spec/policies/public_activity/activity_policy_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe PublicActivity::ActivityPolicy do
subject { described_class }
let(:user) { create(:user) }
let(:another_user) { create(:user) }
let(:viewer) { create(:user) }
let(:contributor) { create(:user) }
let(:activity_owner) { create(:user) }
let(:re... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/tag.rb | spec/factories/tag.rb | # frozen_string_literal: true
FactoryBot.define do
factory :tag do
sequence :name do |n|
"tag#{n}"
end
repository
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/star.rb | spec/factories/star.rb | # frozen_string_literal: true
FactoryBot.define do
factory :star do
repository
user
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/comments.rb | spec/factories/comments.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: comments
#
# id :integer not null, primary key
# body :text(65535)
# repository_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer
#
# Indexes... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/users_factory.rb | spec/factories/users_factory.rb | # frozen_string_literal: true
FactoryBot.define do
factory :user do
sequence(:email) { |n| "test#{n}@localhost.test.lan" }
password { "test-password" }
sequence(:username) { |n| "username#{n}" }
bot { false }
factory :admin do
admin { true }
end
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/webhooks.rb | spec/factories/webhooks.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: webhooks
#
# id :integer not null, primary key
# namespace_id :integer
# url :string(255)
# username :string(255)
# password :string(255)
# request_method :integer
# content_type :integer
# ena... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/webhook_headers.rb | spec/factories/webhook_headers.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: webhook_headers
#
# id :integer not null, primary key
# webhook_id :integer
# name :string(255)
# value :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# i... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/webhook_deliveries.rb | spec/factories/webhook_deliveries.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: webhook_deliveries
#
# id :integer not null, primary key
# webhook_id :integer
# uuid :string(255)
# status :integer
# request_header :text(65535)
# request_body :text(65535)
# response_heade... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/teams_factory.rb | spec/factories/teams_factory.rb | # frozen_string_literal: true
FactoryBot.define do
factory :team do
sequence(:name) { |n| "team_name#{n}" }
owners { |t| [t.association(:user)] }
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/namespaces.rb | spec/factories/namespaces.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: namespaces
#
# id :integer not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# team_id :integer
# registry_id :integer not null
# ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/registry_raw_event.rb | spec/factories/registry_raw_event.rb | # frozen_string_literal: true
require_relative "../support/models/registry_raw_event"
# Docker Registry v2: Push Notifications
# https://docs.docker.com/registry/notifications/#events
FactoryBot.define do
factory :raw_push_manifest_event, class: RegistryRawEvent do
action { "push" }
target do
{
... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/vulnerability.rb | spec/factories/vulnerability.rb | # frozen_string_literal: true
FactoryBot.define do
factory :vulnerability do
sequence(:name) { |n| "vulnerability#{n}" }
severity { "High" }
sequence(:link) { |n| "http://a.link#{n}" }
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/repositories.rb | spec/factories/repositories.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: repositories
#
# id :integer not null, primary key
# name :string(255) default(""), not null
# namespace_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# marked ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/registries.rb | spec/factories/registries.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: registries
#
# id :integer not null, primary key
# name :string(255) not null
# hostname :string(255) not null
# created_at :datetime not null
# updated_at :datetime ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/application_token.rb | spec/factories/application_token.rb | # frozen_string_literal: true
FactoryBot.define do
factory :application_token do
sequence :application do |i|
"application #{i}"
end
# the plain token is application
token_salt { BCrypt::Engine.generate_salt }
token_hash { BCrypt::Engine.hash_secret(application, token_salt) }
associat... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/activities.rb | spec/factories/activities.rb | # frozen_string_literal: true
FactoryBot.define do
factory :activity_team_create, class: PublicActivity::Activity do
owner_type { "User" }
key { "team.create" }
trackable_type { "Team" }
end
factory :activity_team_add_member, class: PublicActivity::Activity do
owner_type { "User" }
key { "te... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/factories/scan_result.rb | spec/factories/scan_result.rb | # frozen_string_literal: true
FactoryBot.define do
factory :scan_result do
tag
vulnerability
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/models/team_spec.rb | spec/models/team_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: teams
#
# id :integer not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# hidden :boolean defaul... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/models/webhook_header_spec.rb | spec/models/webhook_header_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: webhook_headers
#
# id :integer not null, primary key
# webhook_id :integer
# name :string(255)
# value :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# i... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/models/repository_spec.rb | spec/models/repository_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: repositories
#
# id :integer not null, primary key
# name :string(255) default(""), not null
# namespace_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# marked ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | true |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/models/star_spec.rb | spec/models/star_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: stars
#
# id :integer not null, primary key
# user_id :integer
# repository_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_stars_on_repository_i... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/spec/models/webhook_spec.rb | spec/models/webhook_spec.rb | # frozen_string_literal: true
# == Schema Information
#
# Table name: webhooks
#
# id :integer not null, primary key
# namespace_id :integer
# url :string(255)
# username :string(255)
# password :string(255)
# request_method :integer
# content_type :integer
# ena... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.