summaryrefslogtreecommitdiff
path: root/spec/features/signup_spec.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-05-06 17:59:45 -0300
committerFelipe Artur <felipefac@gmail.com>2016-05-16 14:56:32 -0300
commit7bb84e64979edda8e76f077bd58aeb35857aec23 (patch)
tree49af72a948475761144a1aa5c6f42b33debba813 /spec/features/signup_spec.rb
parent0baadd6cff63d5ac0048043381a0b7daff6e01c3 (diff)
downloadgitlab-ce-7bb84e64979edda8e76f077bd58aeb35857aec23.tar.gz
Change landing page when skipping confirmation email and add documentation
Diffstat (limited to 'spec/features/signup_spec.rb')
-rw-r--r--spec/features/signup_spec.rb45
1 files changed, 34 insertions, 11 deletions
diff --git a/spec/features/signup_spec.rb b/spec/features/signup_spec.rb
index c7840f26d8f..4229e82b443 100644
--- a/spec/features/signup_spec.rb
+++ b/spec/features/signup_spec.rb
@@ -2,22 +2,45 @@ require 'spec_helper'
feature 'Signup', feature: true do
describe 'signup with no errors' do
- before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(true) }
- it 'creates the user account and sends a confirmation email' do
- user = build(:user)
+ context "when sending confirmation email" do
+ before { allow_any_instance_of(ApplicationSetting).to receive(:send_user_confirmation_email).and_return(true) }
- visit root_path
+ it 'creates the user account and sends a confirmation email' do
+ user = build(:user)
- 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"
+ 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