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:
authorLong Nguyen <long.polyglot@gmail.com>2016-05-08 18:06:19 +0300
committerLong Nguyen <long.polyglot@gmail.com>2016-05-08 18:06:19 +0300
commit6781c1b4ba8bb1a7da0a4bf637d7a311abf281f0 (patch)
treebc4af2d5f16f5f243e6628b9259ae6c9b2111bcf /spec/controllers
parent29089352e388882a799daff7623fc7213f60e1c9 (diff)
Add specs for user routing and update spec for user controller
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/users_controller_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index 8045c8b940d..c61ec174665 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -112,4 +112,26 @@ describe UsersController do
expect(response).to render_template('calendar_activities')
end
end
+
+ describe 'GET #snippets' do
+ before do
+ sign_in(user)
+ end
+
+ context 'format html' do
+ it 'renders snippets page' do
+ get :snippets, username: user.username
+ expect(response.status).to eq(200)
+ expect(response).to render_template('show')
+ end
+ end
+
+ context 'format json' do
+ it 'response with snippets json data' do
+ get :snippets, username: user.username, format: :json
+ expect(response.status).to eq(200)
+ expect(JSON.parse(response.body)).to have_key('html')
+ end
+ end
+ end
end