Added recent_plantings variable

Wrote tests for recent_plantings, recent_posts, new_crops
This commit is contained in:
Amy
2013-01-28 19:30:23 -05:00
parent ca4e632870
commit 0d84f0dde1
4 changed files with 5 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ class PlantingsController < ApplicationController
respond_to do |format|
format.html # index.html.erb
format.json { render json: @plantings }
format.rss { render :layout => false } #index.rss.builder
end
end

View File

@@ -39,6 +39,7 @@ describe CropsController do
crop = Crop.create! valid_attributes
get :index, {}, valid_session
assigns(:crops).should eq([crop])
assigns(:new_crops).should eq([crop])
end
end

View File

@@ -18,6 +18,7 @@ describe PlantingsController do
planting = Planting.create! valid_attributes
get :index, {}, valid_session
assigns(:plantings).should eq([planting])
assigns(:recent_plantings).should eq([planting])
end
end

View File

@@ -28,6 +28,7 @@ describe PostsController do
post = Post.create! valid_attributes
get :index, {}
assigns(:posts).should eq([post])
assigns(:recent_posts).should eq([post])
end
end