Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
29 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 |
---|---|---|
@@ -1,37 +1,36 @@ | ||
require_relative '../../test_helper' | ||
|
||
class Webui::SignupTest < Webui::IntegrationTest | ||
def signup_user page | ||
# Signup a user | ||
visit page | ||
fill_in 'login', with: 'eisendieter' | ||
fill_in 'email', with: 'dieter.eilts@werder.de' | ||
fill_in 'pwd', with: 'alemao' | ||
click_button('Sign Up') | ||
end | ||
|
||
def signup_user page | ||
# Signup a user | ||
visit page | ||
fill_in 'login', with: 'eisendieter' | ||
fill_in 'email', with: 'dieter.eilts@werder.de' | ||
fill_in 'pwd', with: 'alemao' | ||
click_button('Sign Up') | ||
end | ||
def test_signup_allow | ||
signup_user root_path | ||
flash_message.must_equal 'The account "eisendieter" is now active.' | ||
end | ||
|
||
def test_signup_allow | ||
signup_user root_path | ||
flash_message.must_equal 'The account "eisendieter" is now active.' | ||
end | ||
def test_signup_confirmation | ||
# Configure confirmation for signups | ||
::Configuration.stubs(:registration).returns("confirmation") | ||
signup_user root_path | ||
flash_message.must_equal 'Thank you for signing up! An admin has to confirm your account now. Please be patient.' | ||
end | ||
|
||
def test_signup_confirmation | ||
# Configure confirmation for signups | ||
::Configuration.stubs(:registration).returns("confirmation") | ||
signup_user root_path | ||
flash_message.must_equal 'Thank you for signing up! An admin has to confirm your account now. Please be patient.' | ||
end | ||
|
||
def test_signup_deny | ||
# Configure denying signups | ||
::Configuration.stubs(:registration).returns("deny") | ||
visit user_register_user_path | ||
page.must_have_content "Sorry, sign up is disabled" | ||
# but still works for admin | ||
login_king | ||
visit user_register_user_path | ||
page.must_have_content "Sign Up for an Open Build Service account" | ||
end | ||
def test_signup_deny | ||
# Configure denying signups | ||
::Configuration.stubs(:registration).returns("deny") | ||
visit user_register_user_path | ||
page.must_have_content "Sorry, sign up is disabled" | ||
# but still works for admin | ||
login_king | ||
visit user_register_user_path | ||
page.must_have_content "Sign Up for an Open Build Service account" | ||
end | ||
end | ||
|