diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2019-03-19 03:01:49 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2019-03-19 03:27:28 +0300 |
commit | 585fcfb9e7be7300af04cd2f9c6d1d97d5333cf5 (patch) | |
tree | 3c49516c3df69addbbdc5c08f1c6ff241ed54158 /spec/controllers/explore | |
parent | a3b3da72775fd37f7533ddd88fe47600079b4ed9 (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/explore')
-rw-r--r-- | spec/controllers/explore/projects_controller_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/controllers/explore/projects_controller_spec.rb b/spec/controllers/explore/projects_controller_spec.rb index d57367e931e..7e20ddca249 100644 --- a/spec/controllers/explore/projects_controller_spec.rb +++ b/spec/controllers/explore/projects_controller_spec.rb @@ -1,6 +1,36 @@ require 'spec_helper' describe Explore::ProjectsController do + describe 'GET #index.json' do + render_views + + before do + get :index, format: :json + end + + it { is_expected.to respond_with(:success) } + end + + describe 'GET #trending.json' do + render_views + + before do + get :trending, format: :json + end + + it { is_expected.to respond_with(:success) } + end + + describe 'GET #starred.json' do + render_views + + before do + get :starred, format: :json + end + + it { is_expected.to respond_with(:success) } + end + describe 'GET #trending' do context 'sorting by update date' do let(:project1) { create(:project, :public, updated_at: 3.days.ago) } |