Files
habitica/test/functional/rewards_controller_test.rb
T
2012-02-04 16:52:02 -05:00

50 lines
1019 B
Ruby

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