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
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-02-05 19:47:11 +0300
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-02-05 19:47:11 +0300
commit50e8e5943f182c65be1ef7777d06869029886d8e (patch)
treeff1629bfc6319348d3ec04a65ce6c8290b42af23 /spec
parent31323205bcc3ed663e7a1c5be4c5e5bd5b9ec5a6 (diff)
parentab22caa97e4c1d749f1acfa344c0b1c91eba598b (diff)
Merge branch 'redirect-sign_up' into 'master'
Redirect signup page to signin page. Resolves #1916. See merge request !1468
Diffstat (limited to 'spec')
-rw-r--r--spec/features/users_spec.rb13
-rw-r--r--spec/requests/api/users_spec.rb24
2 files changed, 8 insertions, 29 deletions
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
index 8b237199bcc..21a3a4bf937 100644
--- a/spec/features/users_spec.rb
+++ b/spec/features/users_spec.rb
@@ -1,19 +1,14 @@
require 'spec_helper'
describe 'Users', feature: true do
- describe "GET /users/sign_up" do
- before do
- ApplicationSetting.any_instance.stub(signup_enabled?: true)
- end
-
+ describe "GET /users/sign_in" do
it "should create a new user account" do
- visit new_user_registration_path
+ visit new_user_session_path
fill_in "user_name", with: "Name Surname"
fill_in "user_username", with: "Great"
fill_in "user_email", with: "name@mail.com"
- fill_in "user_password", with: "password1234"
- fill_in "user_password_confirmation", with: "password1234"
- expect { click_button "Sign up" }.to change {User.count}.by(1)
+ fill_in "user_password_sign_up", with: "password1234"
+ expect { click_button "Sign up" }.to change { User.count }.by(1)
end
end
end
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index dec488c6d00..12dfcacec23 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -184,27 +184,11 @@ describe API::API, api: true do
end
describe "GET /users/sign_up" do
- context 'enabled' do
- before do
- ApplicationSetting.any_instance.stub(signup_enabled?: true)
- end
-
- it "should return sign up page if signup is enabled" do
- get "/users/sign_up"
- response.status.should == 200
- end
- end
- context 'disabled' do
- before do
- ApplicationSetting.any_instance.stub(signup_enabled?: false)
- end
-
- it "should redirect to sign in page if signup is disabled" do
- get "/users/sign_up"
- response.status.should == 302
- response.should redirect_to(new_user_session_path)
- end
+ it "should redirect to sign in page" do
+ get "/users/sign_up"
+ response.status.should == 302
+ response.should redirect_to(new_user_session_path)
end
end