Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2012-11-06 17:30:48 +0400
committerMarin Jankovski <maxlazio@gmail.com>2013-01-18 14:57:31 +0400
commit296cdd591f7f01ffdbe18cd6a839bbd0e624dfba (patch)
treefd910106cf092da00a7fbddfe4d6e19b1f9a00eb /spec/requests/admin/admin_users_spec.rb
parentb07e1b3aedf87fdf3ec7a6855cec8194b0a30a59 (diff)
Add optional signup.
Diffstat (limited to 'spec/requests/admin/admin_users_spec.rb')
-rw-r--r--spec/requests/admin/admin_users_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/requests/admin/admin_users_spec.rb b/spec/requests/admin/admin_users_spec.rb
index a66e85a34f9..455caf4a376 100644
--- a/spec/requests/admin/admin_users_spec.rb
+++ b/spec/requests/admin/admin_users_spec.rb
@@ -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