diff --git a/app/controllers/api/v1/projects_controller.rb b/app/controllers/api/v1/projects_controller.rb index a07d448..88ea3e5 100644 --- a/app/controllers/api/v1/projects_controller.rb +++ b/app/controllers/api/v1/projects_controller.rb @@ -10,7 +10,6 @@ def show # returns all projects if user is looking at own projects # returns public projects for users if otherwise def index - # find_project if @project respond_with @project return diff --git a/spec/controllers/api/v1/projects_controller_spec.rb b/spec/controllers/api/v1/projects_controller_spec.rb index 99097ba..d6d9d4b 100644 --- a/spec/controllers/api/v1/projects_controller_spec.rb +++ b/spec/controllers/api/v1/projects_controller_spec.rb @@ -150,6 +150,7 @@ proj4 = Project.create(title: "nonuser private", owner:not_users_id, is_public: 0) get :index, {user_id: user.id}, format: :json project_response = JSON.parse(response.body, symbolize_names: true) + expect(project_response.length).to eq(2) expect(project_response[0][:title]).to eq("user public") expect(project_response[1][:title]).to eq("user private")