Add unit tests for models and services
- Implemented unit tests for the Package model, covering methods such as generateId, findById, findByName, and version management. - Created unit tests for the Repository model, including repository creation, name validation, and retrieval methods. - Added tests for the Session model, focusing on session creation, validation, and invalidation. - Developed unit tests for the User model, ensuring user creation, password hashing, and retrieval methods function correctly. - Implemented AuthService tests, validating login, token refresh, and session management. - Added TokenService tests, covering token creation, validation, and revocation processes.
This commit is contained in:
11
test/fixtures/rubygems/demo-gem/README.md
vendored
Normal file
11
test/fixtures/rubygems/demo-gem/README.md
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# stack-test-demo-gem
|
||||
|
||||
Demo gem for Stack.Gallery Registry e2e tests.
|
||||
|
||||
## Usage
|
||||
|
||||
```ruby
|
||||
require 'demo-gem'
|
||||
|
||||
puts StackTestDemoGem.greet("World") # Hello, World!
|
||||
```
|
||||
16
test/fixtures/rubygems/demo-gem/demo-gem.gemspec
vendored
Normal file
16
test/fixtures/rubygems/demo-gem/demo-gem.gemspec
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "stack-test-demo-gem"
|
||||
spec.version = "1.0.0"
|
||||
spec.authors = ["Stack.Gallery Test"]
|
||||
spec.email = ["test@stack.gallery"]
|
||||
|
||||
spec.summary = "Demo gem for Stack.Gallery Registry e2e tests"
|
||||
spec.description = "A demonstration gem for testing Stack.Gallery Registry"
|
||||
spec.homepage = "https://github.com/stack-gallery/demo-gem"
|
||||
spec.license = "MIT"
|
||||
|
||||
spec.required_ruby_version = ">= 2.7.0"
|
||||
|
||||
spec.files = Dir["lib/**/*", "README.md"]
|
||||
spec.require_paths = ["lib"]
|
||||
end
|
||||
13
test/fixtures/rubygems/demo-gem/lib/demo-gem.rb
vendored
Normal file
13
test/fixtures/rubygems/demo-gem/lib/demo-gem.rb
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Demo gem for Stack.Gallery Registry e2e tests
|
||||
module StackTestDemoGem
|
||||
VERSION = "1.0.0"
|
||||
|
||||
# Greet the given name
|
||||
# @param name [String] The name to greet
|
||||
# @return [String] A greeting message
|
||||
def self.greet(name)
|
||||
"Hello, #{name}!"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user