diff options
author | Alex Legler <alex@a3li.li> | 2011-08-28 12:36:27 +0200 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2011-08-28 12:36:27 +0200 |
commit | fcc0d62f8b73943f748b6f47d5515582b00d6460 (patch) | |
tree | 4064837b82d125ebb830298ffc414de9b32336a5 /test | |
parent | Rename glsa-list css class to glsamaker-table (diff) | |
download | glsamaker-fcc0d62f8b73943f748b6f47d5515582b00d6460.tar.gz glsamaker-fcc0d62f8b73943f748b6f47d5515582b00d6460.tar.bz2 glsamaker-fcc0d62f8b73943f748b6f47d5515582b00d6460.zip |
Add Template model and Admin::TemplateController for managing templates
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/templates.yml | 13 | ||||
-rw-r--r-- | test/functional/admin/templates_controller_test.rb | 49 | ||||
-rw-r--r-- | test/unit/helpers/templates_helper_test.rb | 4 | ||||
-rw-r--r-- | test/unit/template_test.rb | 7 |
4 files changed, 73 insertions, 0 deletions
diff --git a/test/fixtures/templates.yml b/test/fixtures/templates.yml new file mode 100644 index 0000000..4fcb23c --- /dev/null +++ b/test/fixtures/templates.yml @@ -0,0 +1,13 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html + +one: + name: MyString + text: MyText + field: MyString + enabled: false + +two: + name: MyString + text: MyText + field: MyString + enabled: false diff --git a/test/functional/admin/templates_controller_test.rb b/test/functional/admin/templates_controller_test.rb new file mode 100644 index 0000000..8e8f991 --- /dev/null +++ b/test/functional/admin/templates_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class Admin::TemplatesControllerTest < ActionController::TestCase + setup do + @admin_template = admin_templates(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:admin_templates) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create admin_template" do + assert_difference('Admin::Template.count') do + post :create, :admin_template => @admin_template.attributes + end + + assert_redirected_to admin_template_path(assigns(:admin_template)) + end + + test "should show admin_template" do + get :show, :id => @admin_template.to_param + assert_response :success + end + + test "should get edit" do + get :edit, :id => @admin_template.to_param + assert_response :success + end + + test "should update admin_template" do + put :update, :id => @admin_template.to_param, :admin_template => @admin_template.attributes + assert_redirected_to admin_template_path(assigns(:admin_template)) + end + + test "should destroy admin_template" do + assert_difference('Admin::Template.count', -1) do + delete :destroy, :id => @admin_template.to_param + end + + assert_redirected_to admin_templates_path + end +end diff --git a/test/unit/helpers/templates_helper_test.rb b/test/unit/helpers/templates_helper_test.rb new file mode 100644 index 0000000..6aa6ac7 --- /dev/null +++ b/test/unit/helpers/templates_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class TemplatesHelperTest < ActionView::TestCase +end diff --git a/test/unit/template_test.rb b/test/unit/template_test.rb new file mode 100644 index 0000000..a8346d6 --- /dev/null +++ b/test/unit/template_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TemplateTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end |