-
Notifications
You must be signed in to change notification settings - Fork 257
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
5.0/cleanup lifecycles #385
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b4531d6
Fix typo of "nonexistent"
sunnavy f7b3dc7
Clean up lifecycles on save when possible
sunnavy aa4426a
Trim any leading and trailing spaces from name on lifecycle create
sunnavy dbfa304
Do not merge old values for hash configs in database
sunnavy 9fa6147
Support to delete lifecycles
sunnavy da83732
Test lifecycle deletions
sunnavy d2543f3
Show lifecycle warnings to admins who are accessing lifecycle pages
sunnavy 04b1c87
Add protective code in case of invalid lifecycles
sunnavy 7292690
Test lifecycle warnings on admin web UI
sunnavy 3679823
Support to update maps of a lifecycle via JSON on Advanced page
sunnavy 500d385
Add links to help map statuses that have the same name
sunnavy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use strict; | ||
use warnings; | ||
|
||
BEGIN { require './t/lifecycles/utils.pl' } | ||
|
||
my ( $url, $m ) = RT::Test->started_ok; | ||
ok( $m->login(), 'logged in' ); | ||
|
||
diag "Test lifecycle creation"; | ||
|
||
$m->get_ok('/Admin/Lifecycles/Create.html'); | ||
$m->submit_form_ok( | ||
{ | ||
form_name => 'CreateLifecycle', | ||
fields => { Name => ' foobar ', }, # Intentially add spaces to test the auto cleanup. | ||
button => 'Create', | ||
}, | ||
'Create lifecycle foobar' | ||
); | ||
|
||
$m->text_contains( 'foobar', 'Lifecycle foobar created' ); | ||
|
||
# Test if index page has it too | ||
$m->follow_link_ok( { text => 'Select', url_regex => qr{/Admin/Lifecycles} } ); | ||
$m->follow_link_ok( { text => 'foobar' } ); | ||
|
||
|
||
# Test more updates | ||
|
||
|
||
diag "Test lifecycle deletion"; | ||
|
||
$m->follow_link_ok( { url_regex => qr{/Admin/Lifecycles/Advanced.html} } ); | ||
$m->submit_form_ok( | ||
{ | ||
form_name => 'ModifyLifecycleAdvanced', | ||
button => 'Delete', | ||
}, | ||
'Delete lifecycle foobar' | ||
); | ||
|
||
$m->text_contains('Lifecycle foobar deleted'); | ||
$m->follow_link_ok( { text => 'Select', url_regex => qr{/Admin/Lifecycles} } ); | ||
$m->text_lacks( 'foobar', 'foobar is gone' ); | ||
|
||
done_testing; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add tests for the leading/trailing space in lifecycle name fix also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lifecycle name was initially " foobar " on create page and has been auto-corrected to "foobar". I'll add a bit more tests to make sure the name is corrected.