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:
authorAlejandro Rodríguez <alejorro70@gmail.com>2019-03-19 03:01:49 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2019-03-19 03:27:28 +0300
commit585fcfb9e7be7300af04cd2f9c6d1d97d5333cf5 (patch)
tree3c49516c3df69addbbdc5c08f1c6ff241ed54158 /spec/controllers/dashboard
parenta3b3da72775fd37f7533ddd88fe47600079b4ed9 (diff)
Fix undefined variable error on json project views
This mistake seems to have always been there, but it only resulted in errors on the `/explore*.json` since they were the one that _actually_ relied on the local variables.
Diffstat (limited to 'spec/controllers/dashboard')
-rw-r--r--spec/controllers/dashboard/projects_controller_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/controllers/dashboard/projects_controller_spec.rb b/spec/controllers/dashboard/projects_controller_spec.rb
index 2975205e09c..649441f4917 100644
--- a/spec/controllers/dashboard/projects_controller_spec.rb
+++ b/spec/controllers/dashboard/projects_controller_spec.rb
@@ -2,4 +2,30 @@ require 'spec_helper'
describe Dashboard::ProjectsController do
it_behaves_like 'authenticates sessionless user', :index, :atom
+
+ context 'json requests' do
+ render_views
+
+ let(:user) { create(:user) }
+
+ before do
+ sign_in(user)
+ end
+
+ describe 'GET /projects.json' do
+ before do
+ get :index, format: :json
+ end
+
+ it { is_expected.to respond_with(:success) }
+ end
+
+ describe 'GET /starred.json' do
+ before do
+ get :starred, format: :json
+ end
+
+ it { is_expected.to respond_with(:success) }
+ end
+ end
end