mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Added recent_plantings variable
Wrote tests for recent_plantings, recent_posts, new_crops
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user