require'spec_helper'describeExplore::ProjectsControllerdolet(:user){create(:user)}let(:visibility){:public}describe'GET #trending'dolet!(:project_1){create(:project,visibility,ci_id: 1)}let!(:project_2){create(:project,visibility,ci_id: 2)}let!(:trending_project_1){create(:trending_project,project: project_1)}let!(:trending_project_2){create(:trending_project,project: project_2)}beforedosign_in(user)endcontext'sorting by update date'doit'sorts by last updated'doget:trending,sort: 'updated_desc'expect(assigns(:projects)).toeq[project_2,project_1]endit'sorts by oldest updated'doget:trending,sort: 'updated_asc'expect(assigns(:projects)).toeq[project_1,project_2]endendendend