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

test: adding a test that check if preferences edits made by an user are saved #8766

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions tests/integration/modify_user.t
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();
Loading