Initial Commit
This commit is contained in:
29
test/fixtures/assets.yml
vendored
Executable file
29
test/fixtures/assets.yml
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
|
||||
one:
|
||||
tag: MyString
|
||||
name: MyString
|
||||
serial: MyString
|
||||
category: MyString
|
||||
make: MyString
|
||||
order: MyString
|
||||
warranty: 2010-08-06
|
||||
password: MyString
|
||||
location: MyString
|
||||
assigned: MyString
|
||||
status: MyString
|
||||
verified: 2010-08-06 15:58:55
|
||||
|
||||
two:
|
||||
tag: MyString
|
||||
name: MyString
|
||||
serial: MyString
|
||||
category: MyString
|
||||
make: MyString
|
||||
order: MyString
|
||||
warranty: 2010-08-06
|
||||
password: MyString
|
||||
location: MyString
|
||||
assigned: MyString
|
||||
status: MyString
|
||||
verified: 2010-08-06 15:58:55
|
||||
11
test/fixtures/comments.yml
vendored
Executable file
11
test/fixtures/comments.yml
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
|
||||
one:
|
||||
post_id: 1
|
||||
commenter: MyString
|
||||
body: MyText
|
||||
|
||||
two:
|
||||
post_id: 1
|
||||
commenter: MyString
|
||||
body: MyText
|
||||
21
test/fixtures/softwares.yml
vendored
Executable file
21
test/fixtures/softwares.yml
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
key: MyString
|
||||
asset_id:
|
||||
installed: 2010-08-20
|
||||
installed_by: MyString
|
||||
modified: 2010-08-20
|
||||
modified_by: MyString
|
||||
note: MyString
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
key: MyString
|
||||
asset_id:
|
||||
installed: 2010-08-20
|
||||
installed_by: MyString
|
||||
modified: 2010-08-20
|
||||
modified_by: MyString
|
||||
note: MyString
|
||||
45
test/functional/assets_controller_test.rb
Executable file
45
test/functional/assets_controller_test.rb
Executable file
@@ -0,0 +1,45 @@
|
||||
require 'test_helper'
|
||||
|
||||
class AssetsControllerTest < ActionController::TestCase
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:assets)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create asset" do
|
||||
assert_difference('Asset.count') do
|
||||
post :create, :asset => { }
|
||||
end
|
||||
|
||||
assert_redirected_to asset_path(assigns(:asset))
|
||||
end
|
||||
|
||||
test "should show asset" do
|
||||
get :show, :id => assets(:one).to_param
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, :id => assets(:one).to_param
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update asset" do
|
||||
put :update, :id => assets(:one).to_param, :asset => { }
|
||||
assert_redirected_to asset_path(assigns(:asset))
|
||||
end
|
||||
|
||||
test "should destroy asset" do
|
||||
assert_difference('Asset.count', -1) do
|
||||
delete :destroy, :id => assets(:one).to_param
|
||||
end
|
||||
|
||||
assert_redirected_to assets_path
|
||||
end
|
||||
end
|
||||
45
test/functional/comments_controller_test.rb
Executable file
45
test/functional/comments_controller_test.rb
Executable file
@@ -0,0 +1,45 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CommentsControllerTest < ActionController::TestCase
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:comments)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create comment" do
|
||||
assert_difference('Comment.count') do
|
||||
post :create, :comment => { }
|
||||
end
|
||||
|
||||
assert_redirected_to comment_path(assigns(:comment))
|
||||
end
|
||||
|
||||
test "should show comment" do
|
||||
get :show, :id => comments(:one).to_param
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, :id => comments(:one).to_param
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update comment" do
|
||||
put :update, :id => comments(:one).to_param, :comment => { }
|
||||
assert_redirected_to comment_path(assigns(:comment))
|
||||
end
|
||||
|
||||
test "should destroy comment" do
|
||||
assert_difference('Comment.count', -1) do
|
||||
delete :destroy, :id => comments(:one).to_param
|
||||
end
|
||||
|
||||
assert_redirected_to comments_path
|
||||
end
|
||||
end
|
||||
45
test/functional/softwares_controller_test.rb
Executable file
45
test/functional/softwares_controller_test.rb
Executable file
@@ -0,0 +1,45 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SoftwaresControllerTest < ActionController::TestCase
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:softwares)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create software" do
|
||||
assert_difference('Software.count') do
|
||||
post :create, :software => { }
|
||||
end
|
||||
|
||||
assert_redirected_to software_path(assigns(:software))
|
||||
end
|
||||
|
||||
test "should show software" do
|
||||
get :show, :id => softwares(:one).to_param
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, :id => softwares(:one).to_param
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update software" do
|
||||
put :update, :id => softwares(:one).to_param, :software => { }
|
||||
assert_redirected_to software_path(assigns(:software))
|
||||
end
|
||||
|
||||
test "should destroy software" do
|
||||
assert_difference('Software.count', -1) do
|
||||
delete :destroy, :id => softwares(:one).to_param
|
||||
end
|
||||
|
||||
assert_redirected_to softwares_path
|
||||
end
|
||||
end
|
||||
9
test/performance/browsing_test.rb
Executable file
9
test/performance/browsing_test.rb
Executable file
@@ -0,0 +1,9 @@
|
||||
require 'test_helper'
|
||||
require 'performance_test_help'
|
||||
|
||||
# Profiling results for each test method are written to tmp/performance.
|
||||
class BrowsingTest < ActionController::PerformanceTest
|
||||
def test_homepage
|
||||
get '/'
|
||||
end
|
||||
end
|
||||
38
test/test_helper.rb
Executable file
38
test/test_helper.rb
Executable file
@@ -0,0 +1,38 @@
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
||||
require 'test_help'
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
# Transactional fixtures accelerate your tests by wrapping each test method
|
||||
# in a transaction that's rolled back on completion. This ensures that the
|
||||
# test database remains unchanged so your fixtures don't have to be reloaded
|
||||
# between every test method. Fewer database queries means faster tests.
|
||||
#
|
||||
# Read Mike Clark's excellent walkthrough at
|
||||
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
||||
#
|
||||
# Every Active Record database supports transactions except MyISAM tables
|
||||
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
||||
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
||||
# is recommended.
|
||||
#
|
||||
# The only drawback to using transactional fixtures is when you actually
|
||||
# need to test transactions. Since your test is bracketed by a transaction,
|
||||
# any transactions started in your code will be automatically rolled back.
|
||||
self.use_transactional_fixtures = true
|
||||
|
||||
# Instantiated fixtures are slow, but give you @david where otherwise you
|
||||
# would need people(:david). If you don't want to migrate your existing
|
||||
# test cases which use the @david style and don't mind the speed hit (each
|
||||
# instantiated fixtures translates to a database query per test method),
|
||||
# then set this back to true.
|
||||
self.use_instantiated_fixtures = false
|
||||
|
||||
# Setup all fixtures in test/fixtures/*.(yml|csv) 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
|
||||
8
test/unit/asset_test.rb
Executable file
8
test/unit/asset_test.rb
Executable file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class AssetTest < ActiveSupport::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/unit/comment_test.rb
Executable file
8
test/unit/comment_test.rb
Executable file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CommentTest < ActiveSupport::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
4
test/unit/helpers/assets_helper_test.rb
Executable file
4
test/unit/helpers/assets_helper_test.rb
Executable file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class AssetsHelperTest < ActionView::TestCase
|
||||
end
|
||||
4
test/unit/helpers/comments_helper_test.rb
Executable file
4
test/unit/helpers/comments_helper_test.rb
Executable file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CommentsHelperTest < ActionView::TestCase
|
||||
end
|
||||
4
test/unit/helpers/softwares_helper_test.rb
Executable file
4
test/unit/helpers/softwares_helper_test.rb
Executable file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SoftwaresHelperTest < ActionView::TestCase
|
||||
end
|
||||
8
test/unit/software_test.rb
Executable file
8
test/unit/software_test.rb
Executable file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SoftwareTest < ActiveSupport::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user