diff options
author | Felipe Artur <felipefac@gmail.com> | 2018-07-25 23:53:57 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2018-07-25 23:53:57 +0300 |
commit | 5f8c593a6907f5521ea155fa2bc1273022b36341 (patch) | |
tree | 62a1b59d32f336d0e2de3c8b96286de1f4704994 | |
parent | d93eb03d5c2855a166772e425cc74da572a5c2fc (diff) |
Fix spec/controllers/users/terms_controller_spec.rb spec
-rw-r--r-- | spec/controllers/users/terms_controller_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/controllers/users/terms_controller_spec.rb b/spec/controllers/users/terms_controller_spec.rb index a744463413c..d37f12efac6 100644 --- a/spec/controllers/users/terms_controller_spec.rb +++ b/spec/controllers/users/terms_controller_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' describe Users::TermsController do let(:user) { create(:user) } - let(:term) { create(:term) } before do sign_in user @@ -16,13 +15,17 @@ describe Users::TermsController do end it 'shows terms when they exist' do - term + create(:term) + + get :index expect(response).to have_gitlab_http_status(:success) end end describe 'POST #accept' do + let(:term) { create(:term) } + it 'saves that the user accepted the terms' do post :accept, id: term.id @@ -46,6 +49,8 @@ describe Users::TermsController do end context 'redirecting to another domain' do + let(:term) { create(:term) } + it 'is prevented when passing a redirect param' do post :accept, id: term.id, redirect: '//example.com/random/path' @@ -63,6 +68,8 @@ describe Users::TermsController do end describe 'POST #decline' do + let(:term) { create(:term) } + it 'stores that the user declined the terms' do post :decline, id: term.id |