-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adding a test that check if preferences edits made by an user a…
…re saved (#8766)
- Loading branch information
1 parent
2eab21e
commit 0af2f09
Showing
1 changed file
with
36 additions
and
0 deletions.
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,36 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use ProductOpener::PerlStandards; | ||
|
||
use Test::More; | ||
use ProductOpener::APITest qw/:all/; | ||
use ProductOpener::Test qw/:all/; | ||
use ProductOpener::TestDefaults qw/:all/; | ||
|
||
remove_all_users(); | ||
wait_application_ready(); | ||
my $ua = new_client(); | ||
|
||
my %create_user_args = (%default_user_form, (email => 'bob@test.com')); | ||
create_user($ua, \%create_user_args); | ||
|
||
#editing the user preferences | ||
my %edit_form = ( | ||
email => 'notbob@test.com', | ||
name => 'NotTest', | ||
userid => 'tests', | ||
pro_checkbox => 1, | ||
action => "process", | ||
type => "edit" | ||
|
||
); | ||
my $url_edit = construct_test_url("/cgi/user.pl", "world"); | ||
my $response_edit = $ua->post($url_edit, \%edit_form); | ||
|
||
#checking if the changes were saved | ||
my $url_check = construct_test_url("/cgi/user.pl?type=edit&userid=tests", "world"); | ||
my $response_check = $ua->get($url_check); | ||
like($response_check->content, qr/notbob\@test\.com/, "the new email has been well saved"); | ||
like($response_check->content, qr/NotTest/, "the new name has been well saved"); | ||
|
||
done_testing(); |