Adding rewards scaffold

This commit is contained in:
Tyler Renelle
2012-02-04 16:49:11 -05:00
parent 3abcf468e9
commit 50f713e7e9
17 changed files with 280 additions and 0 deletions
@@ -0,0 +1,49 @@
require 'test_helper'
class RewardsControllerTest < ActionController::TestCase
setup do
@reward = rewards(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:rewards)
end
test "should get new" do
get :new
assert_response :success
end
test "should create reward" do
assert_difference('Reward.count') do
post :create, reward: @reward.attributes
end
assert_redirected_to reward_path(assigns(:reward))
end
test "should show reward" do
get :show, id: @reward
assert_response :success
end
test "should get edit" do
get :edit, id: @reward
assert_response :success
end
test "should update reward" do
put :update, id: @reward, reward: @reward.attributes
assert_redirected_to reward_path(assigns(:reward))
end
test "should destroy reward" do
assert_difference('Reward.count', -1) do
delete :destroy, id: @reward
end
assert_redirected_to rewards_path
end
end