From cf1b60e0cfa7d1a8f4a80d686649cc12e73a634e Mon Sep 17 00:00:00 2001 From: hukl Date: Fri, 24 Apr 2009 11:43:08 +0200 Subject: Integrated basic Asset upload functionality. You can upload files now and use their url in pages. --- test/fixtures/assets.yml | 7 +++++ test/functional/assets_controller_test.rb | 45 +++++++++++++++++++++++++++++++ test/unit/asset_test.rb | 8 ++++++ test/unit/helpers/assets_helper_test.rb | 4 +++ 4 files changed, 64 insertions(+) create mode 100644 test/fixtures/assets.yml create mode 100644 test/functional/assets_controller_test.rb create mode 100644 test/unit/asset_test.rb create mode 100644 test/unit/helpers/assets_helper_test.rb (limited to 'test') diff --git a/test/fixtures/assets.yml b/test/fixtures/assets.yml new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/test/fixtures/assets.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +# one: +# column: value +# +# two: +# column: value diff --git a/test/functional/assets_controller_test.rb b/test/functional/assets_controller_test.rb new file mode 100644 index 0000000..7b838cc --- /dev/null +++ b/test/functional/assets_controller_test.rb @@ -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 diff --git a/test/unit/asset_test.rb b/test/unit/asset_test.rb new file mode 100644 index 0000000..58aba76 --- /dev/null +++ b/test/unit/asset_test.rb @@ -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 diff --git a/test/unit/helpers/assets_helper_test.rb b/test/unit/helpers/assets_helper_test.rb new file mode 100644 index 0000000..ae50bff --- /dev/null +++ b/test/unit/helpers/assets_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class AssetsHelperTest < ActionView::TestCase +end -- cgit v1.3