summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-07-16 09:51:20 +0200
committerMarin Jankovski <marin@gitlab.com>2014-07-16 09:51:20 +0200
commit8968f6d874171edc4a95027ac25d2cf83e8b7858 (patch)
tree99edb981639f8ccc5fb5b75f49967c1740bfcf66
parent44b819833407b81fd97873bebffc939c23294595 (diff)
downloadgitlab-ce-8968f6d874171edc4a95027ac25d2cf83e8b7858.tar.gz
Update specs.
-rw-r--r--app/mailers/emails/profile.rb2
-rw-r--r--spec/mailers/notify_spec.rb10
2 files changed, 8 insertions, 4 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index 4498b30691f..f8a7d133d1d 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -1,6 +1,6 @@
module Emails
module Profile
- def new_user_email(user_id, password, token)
+ def new_user_email(user_id, password, token = nil)
@user = User.find(user_id)
@password = password
@target_url = user_url(@user)
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index d7230ec4341..314b2691c40 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -43,7 +43,7 @@ describe Notify do
let(:example_site_path) { root_path }
let(:new_user) { create(:user, email: 'newguy@example.com', created_by_id: 1) }
- subject { Notify.new_user_email(new_user.id, new_user.password) }
+ subject { Notify.new_user_email(new_user.id, new_user.password, 'kETLwRaayvigPq_x3SNM') }
it_behaves_like 'an email sent from GitLab'
@@ -59,8 +59,12 @@ describe Notify do
should have_body_text /#{new_user.email}/
end
- it 'contains the new user\'s password' do
- should have_body_text /password/
+ it 'contains the password text' do
+ should have_body_text /Click here to set your password/
+ end
+
+ it 'includes a link for user to set password' do
+ should have_body_text 'http://localhost/users/password/edit?reset_password_token=kETLwRaayvigPq_x3SNM'
end
it 'includes a link to the site' do