Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUBY-3220] Add project name validation logic to submit proposal #916

Merged

Conversation

jjromeo
Copy link
Contributor

@jjromeo jjromeo commented Sep 17, 2024

  • Updated project_name_complete? method to check for blank names, valid characters, and uniqueness.
  • Introduced PROJECT_NAME_REGEX constant in ProjectNameStep for name format validation.
  • Added comprehensive RSpec tests for various project name validation scenarios.

- Updated `project_name_complete?` method to check for blank names, valid characters, and uniqueness.
- Introduced `PROJECT_NAME_REGEX` constant in `ProjectNameStep` for name format validation.
- Added comprehensive RSpec tests for various project name validation scenarios.
@jjromeo jjromeo force-pushed the RUBY-3220-add-character-validation-on-project-name-field branch from 96b217c to 70771ed Compare September 17, 2024 15:23
return add_error(:project_name, "The project name must only contain letters, underscores, hyphens and numbers")
end

if PafsCore::Project.where.not(id: project.id).exists?(name: name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .not threw me - please add a comment explaining that this is to find any other projects with the same name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored to improve clarity

@jjromeo jjromeo merged commit 56f2593 into main Sep 18, 2024
4 checks passed
@jjromeo jjromeo deleted the RUBY-3220-add-character-validation-on-project-name-field branch September 18, 2024 12:14
@jjromeo jjromeo added the bug label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants