Add optional signup.

This commit is contained in:
Marin Jankovski 2012-11-06 14:30:48 +01:00
parent b07e1b3aed
commit 296cdd591f
14 changed files with 125 additions and 25 deletions

View file

@ -49,6 +49,7 @@ describe "Admin::Users" do
end
it "should send valid email to user with email & password" do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false)
User.observers.enable :user_observer do
click_button "Save"
user = User.last
@ -58,6 +59,18 @@ describe "Admin::Users" do
email.body.should have_content(@password)
end
end
it "should send valid email to user with email without password when signup is enabled" do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
User.observers.enable :user_observer do
click_button "Save"
user = User.last
email = ActionMailer::Base.deliveries.last
email.subject.should have_content("Account was created")
email.body.should have_content(user.email)
email.body.should_not have_content(@password)
end
end
end
describe "GET /admin/users/:id" do