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

0
test/controllers/.keep Normal file
View File

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class GuessesControllerTest < ActionController::TestCase
setup do
@guess = guesses(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:guesses)
end
test "should get new" do
get :new
assert_response :success
end
test "should create guess" do
assert_difference('Guess.count') do
post :create, guess: { definition: @guess.definition, username: @guess.username }
end
assert_redirected_to guess_path(assigns(:guess))
end
test "should show guess" do
get :show, id: @guess
assert_response :success
end
test "should get edit" do
get :edit, id: @guess
assert_response :success
end
test "should update guess" do
patch :update, id: @guess, guess: { definition: @guess.definition, username: @guess.username }
assert_redirected_to guess_path(assigns(:guess))
end
test "should destroy guess" do
assert_difference('Guess.count', -1) do
delete :destroy, id: @guess
end
assert_redirected_to guesses_path
end
end

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class ResultsControllerTest < ActionController::TestCase
setup do
@result = results(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:results)
end
test "should get new" do
get :new
assert_response :success
end
test "should create result" do
assert_difference('Result.count') do
post :create, result: { time: @result.time, user_id: @result.user_id }
end
assert_redirected_to result_path(assigns(:result))
end
test "should show result" do
get :show, id: @result
assert_response :success
end
test "should get edit" do
get :edit, id: @result
assert_response :success
end
test "should update result" do
patch :update, id: @result, result: { time: @result.time, user_id: @result.user_id }
assert_redirected_to result_path(assigns(:result))
end
test "should destroy result" do
assert_difference('Result.count', -1) do
delete :destroy, id: @result
end
assert_redirected_to results_path
end
end

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

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
setup do
@user = users(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:users)
end
test "should get new" do
get :new
assert_response :success
end
test "should create user" do
assert_difference('User.count') do
post :create, user: { smf_id: @user.smf_id, username: @user.username }
end
assert_redirected_to user_path(assigns(:user))
end
test "should show user" do
get :show, id: @user
assert_response :success
end
test "should get edit" do
get :edit, id: @user
assert_response :success
end
test "should update user" do
patch :update, id: @user, user: { smf_id: @user.smf_id, username: @user.username }
assert_redirected_to user_path(assigns(:user))
end
test "should destroy user" do
assert_difference('User.count', -1) do
delete :destroy, id: @user
end
assert_redirected_to users_path
end
end

0
test/fixtures/.keep vendored Normal file
View File

9
test/fixtures/guesses.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
username: MyString
definition: MyString
two:
username: MyString
definition: MyString

9
test/fixtures/results.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
user_id: 1
time: MyString
two:
user_id: 1
time: MyString

11
test/fixtures/solutions.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
number: 1
time: MyString
username: MyString
two:
number: 1
time: MyString
username: MyString

9
test/fixtures/users.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
username: MyString
smf_id: 1
two:
username: MyString
smf_id: 1

0
test/helpers/.keep Normal file
View File

View File

@@ -0,0 +1,4 @@
require 'test_helper'
class GuessesHelperTest < ActionView::TestCase
end

View File

@@ -0,0 +1,4 @@
require 'test_helper'
class ResultsHelperTest < ActionView::TestCase
end

View File

@@ -0,0 +1,4 @@
require 'test_helper'
class SolutionsHelperTest < ActionView::TestCase
end

View File

@@ -0,0 +1,4 @@
require 'test_helper'
class UsersHelperTest < ActionView::TestCase
end

0
test/integration/.keep Normal file
View File

0
test/mailers/.keep Normal file
View File

0
test/models/.keep Normal file
View File

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class GuessTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class ResultTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class SolutionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

7
test/models/user_test.rb Normal file
View File

@@ -0,0 +1,7 @@
require 'test_helper'
class UserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

15
test/test_helper.rb Normal file
View File

@@ -0,0 +1,15 @@
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end