Got uploading working

This commit is contained in:
2012-08-24 21:14:51 -07:00
commit b28efe046c
70 changed files with 1854 additions and 0 deletions

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

13
test/fixtures/users.yml vendored Normal file
View 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
View File

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 => { :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

View File

View 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
View 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
View File

View File

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

7
test/unit/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