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
diff options
context:
space:
mode:
authortauriedavis <taurie@gitlab.com>2018-05-26 02:17:57 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-06-04 23:22:11 +0300
commit285ffb223896f2226531be2ba10933414194155c (patch)
treecd6faec94ab2e4f65b0ed48f458b580b2853fac9 /spec/controllers/users
parent35ba75f6b93c77f078ab2cf538a256f8aa534eb3 (diff)
Messaging on terms page when user already accepted
We show a blue flash banner if the user already accepted, and show a button allowing them to continue to the application.
Diffstat (limited to 'spec/controllers/users')
-rw-r--r--spec/controllers/users/terms_controller_spec.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/controllers/users/terms_controller_spec.rb b/spec/controllers/users/terms_controller_spec.rb
index a744463413c..0d77e91a67d 100644
--- a/spec/controllers/users/terms_controller_spec.rb
+++ b/spec/controllers/users/terms_controller_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'
describe Users::TermsController do
+ include TermsHelper
let(:user) { create(:user) }
let(:term) { create(:term) }
@@ -15,10 +16,25 @@ describe Users::TermsController do
expect(response).to have_gitlab_http_status(:redirect)
end
- it 'shows terms when they exist' do
- term
+ context 'when terms exist' do
+ before do
+ stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
+ term
+ end
+
+ it 'shows terms when they exist' do
+ get :index
+
+ expect(response).to have_gitlab_http_status(:success)
+ end
- expect(response).to have_gitlab_http_status(:success)
+ it 'shows a message when the user already accepted the terms' do
+ accept_terms(user)
+
+ get :index
+
+ expect(controller).to set_flash.now[:notice].to(/already accepted/)
+ end
end
end