Surprise Rails app!
This commit is contained in:
0
test/fixtures/.gitkeep
vendored
Normal file
0
test/fixtures/.gitkeep
vendored
Normal file
9
test/fixtures/door_logs.yml
vendored
Normal file
9
test/fixtures/door_logs.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
one:
|
||||
key: MyString
|
||||
data: 1
|
||||
|
||||
two:
|
||||
key: MyString
|
||||
data: 1
|
||||
13
test/fixtures/users.yml
vendored
Normal file
13
test/fixtures/users.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
card_id: 1
|
||||
card_number: MyString
|
||||
card_permissions: 1
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
card_id: 1
|
||||
card_number: MyString
|
||||
card_permissions: 1
|
||||
0
test/functional/.gitkeep
Normal file
0
test/functional/.gitkeep
Normal file
49
test/functional/door_logs_controller_test.rb
Normal file
49
test/functional/door_logs_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class DoorLogsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@door_log = door_logs(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:door_logs)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create door_log" do
|
||||
assert_difference('DoorLog.count') do
|
||||
post :create, :door_log => { :data => @door_log.data, :key => @door_log.key }
|
||||
end
|
||||
|
||||
assert_redirected_to door_log_path(assigns(:door_log))
|
||||
end
|
||||
|
||||
test "should show door_log" do
|
||||
get :show, :id => @door_log
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, :id => @door_log
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update door_log" do
|
||||
put :update, :id => @door_log, :door_log => { :data => @door_log.data, :key => @door_log.key }
|
||||
assert_redirected_to door_log_path(assigns(:door_log))
|
||||
end
|
||||
|
||||
test "should destroy door_log" do
|
||||
assert_difference('DoorLog.count', -1) do
|
||||
delete :destroy, :id => @door_log
|
||||
end
|
||||
|
||||
assert_redirected_to door_logs_path
|
||||
end
|
||||
end
|
||||
49
test/functional/users_controller_test.rb
Normal file
49
test/functional/users_controller_test.rb
Normal 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 => { :card_id => @user.card_id, :card_number => @user.card_number, :card_permissions => @user.card_permissions, :name => @user.name }
|
||||
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
|
||||
put :update, :id => @user, :user => { :card_id => @user.card_id, :card_number => @user.card_number, :card_permissions => @user.card_permissions, :name => @user.name }
|
||||
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/integration/.gitkeep
Normal file
0
test/integration/.gitkeep
Normal file
12
test/performance/browsing_test.rb
Normal file
12
test/performance/browsing_test.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
require 'test_helper'
|
||||
require 'rails/performance_test_help'
|
||||
|
||||
class BrowsingTest < ActionDispatch::PerformanceTest
|
||||
# Refer to the documentation for all available options
|
||||
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
|
||||
# :output => 'tmp/performance', :formats => [:flat] }
|
||||
|
||||
def test_homepage
|
||||
get '/'
|
||||
end
|
||||
end
|
||||
13
test/test_helper.rb
Normal file
13
test/test_helper.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
# 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
|
||||
0
test/unit/.gitkeep
Normal file
0
test/unit/.gitkeep
Normal file
7
test/unit/door_log_test.rb
Normal file
7
test/unit/door_log_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class DoorLogTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
4
test/unit/helpers/door_logs_helper_test.rb
Normal file
4
test/unit/helpers/door_logs_helper_test.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class DoorLogsHelperTest < ActionView::TestCase
|
||||
end
|
||||
4
test/unit/helpers/users_helper_test.rb
Normal file
4
test/unit/helpers/users_helper_test.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UsersHelperTest < ActionView::TestCase
|
||||
end
|
||||
7
test/unit/user_test.rb
Normal file
7
test/unit/user_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UserTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user