initial commit

This commit is contained in:
Senad Uka
2013-12-09 03:23:49 +01:00
parent 9582c13e0c
commit e8751fa215
204 changed files with 6675 additions and 41 deletions

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class SolutionsControllerTest < ActionController::TestCase
setup do
@solution = solutions(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:solutions)
end
test "should get new" do
get :new
assert_response :success
end
test "should create solution" do
assert_difference('Solution.count') do
post :create, solution: { number: @solution.number, time: @solution.time, username: @solution.username }
end
assert_redirected_to solution_path(assigns(:solution))
end
test "should show solution" do
get :show, id: @solution
assert_response :success
end
test "should get edit" do
get :edit, id: @solution
assert_response :success
end
test "should update solution" do
patch :update, id: @solution, solution: { number: @solution.number, time: @solution.time, username: @solution.username }
assert_redirected_to solution_path(assigns(:solution))
end
test "should destroy solution" do
assert_difference('Solution.count', -1) do
delete :destroy, id: @solution
end
assert_redirected_to solutions_path
end
end