summaryrefslogtreecommitdiff
path: root/spec/features/signup_spec.rb
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-05-18 13:05:53 -0500
committerFatih Acet <acetfatih@gmail.com>2016-05-18 13:05:53 -0500
commitbb883387f9e4d5564b455cce7d412f730664a2f5 (patch)
tree02f972c30f9a01d605e2c88a22b2c7172694e475 /spec/features/signup_spec.rb
parent7a4e7ad04e1fc96953d9159e8e1a2208990d34f7 (diff)
parentb7d83acf5b03e08dc9e387e1abb83c5e3c80444c (diff)
downloadgitlab-ce-bb883387f9e4d5564b455cce7d412f730664a2f5.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts: # app/controllers/projects/merge_requests_controller.rb # app/models/note.rb # db/schema.rb # spec/models/note_spec.rb
Diffstat (limited to 'spec/features/signup_spec.rb')
-rw-r--r--spec/features/signup_spec.rb45
1 files changed, 35 insertions, 10 deletions
diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb
index 58aabd913eb..4229e82b443 100644
--- a/spec/features/signup_spec.rb
+++ b/spec/features/signup_spec.rb
@@ -2,20 +2,45 @@ require 'spec_helper'
feature 'Signup', feature: true do
describe 'signup with no errors' do
- it 'creates the user account and sends a confirmation email' do
- user = build(:user)
- visit root_path
+ context "when sending confirmation email" do
+ before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(true) }
- fill_in 'new_user_name', with: user.name
- fill_in 'new_user_username', with: user.username
- fill_in 'new_user_email', with: user.email
- fill_in 'new_user_password', with: user.password
- click_button "Sign up"
+ it 'creates the user account and sends a confirmation email' do
+ user = build(:user)
+
+ visit root_path
+
+ fill_in 'new_user_name', with: user.name
+ fill_in 'new_user_username', with: user.username
+ fill_in 'new_user_email', with: user.email
+ fill_in 'new_user_password', with: user.password
+ click_button "Sign up"
- expect(current_path).to eq users_almost_there_path
- expect(page).to have_content("Please check your email to confirm your account")
+ expect(current_path).to eq users_almost_there_path
+ expect(page).to have_content("Please check your email to confirm your account")
+ end
end
+
+ context "when not sending confirmation email" do
+ before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(false) }
+
+ it 'creates the user account and goes to dashboard' do
+ user = build(:user)
+
+ visit root_path
+
+ fill_in 'new_user_name', with: user.name
+ fill_in 'new_user_username', with: user.username
+ fill_in 'new_user_email', with: user.email
+ fill_in 'new_user_password', with: user.password
+ click_button "Sign up"
+
+ expect(current_path).to eq dashboard_projects_path
+ expect(page).to have_content("Welcome! You have signed up successfully.")
+ end
+ end
+
end
describe 'signup with errors' do