ripping out old functional tests, no more haml
Oleg
committed Aug 27, 2010
commit ca6d111846770d0317c7099d1639158428f43add
Showing 11
changed files with
27 additions
and 343 deletions
Gemfile
+1
-2
| @@ | @@ -3,8 +3,7 @@ source 'http://rubygems.org' |
| gem 'rails', '3.0.0.rc' | |
| gem 'sqlite3-ruby', :require => 'sqlite3' | |
| - | gem 'haml' |
| - | gem 'active_link_to' |
| + | gem 'active_link_to', '>=0.0.6' |
| group :test do | |
| gem 'redgreen' | |
Gemfile.lock
+1
-3
| @@ | @@ -34,7 +34,6 @@ GEM |
| builder (2.1.2) | |
| erubis (2.6.6) | |
| abstract (>= 1.0.0) | |
| - | haml (3.0.17) |
| i18n (0.4.1) | |
| mail (2.2.5) | |
| activesupport (>= 2.3.6) | |
| @@ | @@ -72,8 +71,7 @@ PLATFORMS |
| ruby | |
| DEPENDENCIES | |
| - | active_link_to |
| - | haml |
| + | active_link_to (>= 0.0.6) |
| rails (= 3.0.0.rc) | |
| redgreen | |
| sqlite3-ruby | |
config/application.rb
+0
-2
| @@ | @@ -6,8 +6,6 @@ require 'rails/all' |
| # you've limited to :test, :development, or :production. | |
| Bundler.require(:default, Rails.env) if defined?(Bundler) | |
| - | |
| - | |
| module ComfortableMexicanSofa | |
| class Application < Rails::Application | |
test/functional/cms_admin/base_controller_test.rb
+3
-9
| @@ | @@ -2,14 +2,8 @@ require File.dirname(__FILE__) + '/../../test_helper' |
| class CmsAdmin::BaseControllerTest < ActionController::TestCase | |
| - | def setup |
| - | http_auth |
| + | def test_something |
| + | flunk |
| end | |
| - | def test_index |
| - | get :index |
| - | assert_redirected_to cms_admin_pages_path |
| - | end |
| - | |
| - | |
| - | end |
| + | end |
| \ No newline at end of file | |
test/functional/cms_admin/layouts_controller_test.rb
+3
-81
| @@ | @@ -2,86 +2,8 @@ require File.dirname(__FILE__) + '/../../test_helper' |
| class CmsAdmin::LayoutsControllerTest < ActionController::TestCase | |
| - | def setup |
| - | http_auth |
| + | def test_something |
| + | flunk |
| end | |
| - | def test_get_index |
| - | get :index |
| - | assert_response :success |
| - | assert assigns(:cms_layouts) |
| - | end |
| - | |
| - | def test_get_new |
| - | get :new |
| - | assert_response :success |
| - | end |
| - | |
| - | def test_get_edit |
| - | get :edit, :id => cms_layouts(:default) |
| - | assert_response :success |
| - | assert assigns(:cms_layout) |
| - | end |
| - | |
| - | def test_create |
| - | assert_difference 'CmsLayout.count' do |
| - | post :create, :cms_layout => { |
| - | :label => 'Test Layout', |
| - | :parent_id => '', |
| - | :app_layout => '', |
| - | :content => 'Test content {{ cms_block:test_block:text }}' |
| - | } |
| - | assert_response :redirect |
| - | assert_redirected_to edit_cms_admin_layout_path(assigns(:cms_layout)) |
| - | assert_equal 'Layout created', flash[:notice] |
| - | end |
| - | end |
| - | |
| - | def test_update |
| - | layout = cms_layouts(:default) |
| - | |
| - | assert_difference 'CmsBlock.count', layout.cms_pages.count do |
| - | put :update, :id => layout, :cms_layout => { |
| - | :label => 'New Test Label', |
| - | :content => '{{ cms_block:completely_new_block:string }}' |
| - | } |
| - | assert_response :redirect |
| - | assert_redirected_to edit_cms_admin_layout_path(assigns(:cms_layout)) |
| - | assert_equal 'Layout updated', flash[:notice] |
| - | |
| - | layout.reload |
| - | assert_equal 'New Test Label', layout.label |
| - | assert_equal '{{ cms_block:completely_new_block:string }}', layout.content |
| - | end |
| - | end |
| - | |
| - | def test_destroy |
| - | layout = cms_layouts(:default) |
| - | assert !(layout_pages = layout.cms_pages).blank? |
| - | |
| - | assert_equal 1, layout.descendants.size |
| - | |
| - | assert_difference 'CmsLayout.count', -2 do |
| - | assert_no_difference ['CmsPage.count', 'CmsBlock.count'] do |
| - | delete :destroy, :id => layout |
| - | assert_response :redirect |
| - | assert_redirected_to cms_admin_layouts_path |
| - | assert_equal 'Layout removed', flash[:notice] |
| - | |
| - | layout_pages.each do |page| |
| - | assert !page.cms_layout |
| - | end |
| - | end |
| - | end |
| - | end |
| - | |
| - | def test_toggle |
| - | assert !session[:cms_layout] |
| - | # Expand |
| - | post :toggle, :id => cms_layouts(:default) |
| - | assert session[:cms_layout].include?(cms_layouts(:default).id) |
| - | # Collapse |
| - | post :toggle, :id => cms_layouts(:default) |
| - | assert !session[:cms_layout].include?(cms_layouts(:default).id) |
| - | end |
| - | end |
| + | end |
| \ No newline at end of file | |
test/functional/cms_admin/pages_controller_test.rb
+3
-132
| @@ | @@ -2,137 +2,8 @@ require File.dirname(__FILE__) + '/../../test_helper' |
| class CmsAdmin::PagesControllerTest < ActionController::TestCase | |
| - | def setup |
| - | http_auth |
| + | def test_something |
| + | flunk |
| end | |
| - | def test_get_index |
| - | get :index |
| - | assert_response :success |
| - | assert assigns(:cms_pages) |
| - | end |
| - | |
| - | def test_get_new |
| - | get :new |
| - | assert_response :success |
| - | end |
| - | |
| - | def test_get_edit |
| - | get :edit, :id => cms_pages(:default) |
| - | assert_response :success |
| - | assert assigns(:cms_page) |
| - | end |
| - | |
| - | def test_create |
| - | assert_difference 'CmsPage.count' do |
| - | assert_difference 'CmsBlock.count', 3 do |
| - | post :create, :cms_page => { |
| - | :label => 'Test Page', |
| - | :slug => 'test_page', |
| - | :cms_layout => cms_layouts(:default), |
| - | :blocks => { |
| - | :header => { :content_string => 'Test Header' }, |
| - | :default => { :content_text => 'Test Content' }, |
| - | :footer => { :content_text => 'Test Footer' } |
| - | } |
| - | } |
| - | assert_response :redirect |
| - | assert_redirected_to edit_cms_admin_page_path(assigns(:cms_page)) |
| - | assert_equal 'Page created', flash[:notice] |
| - | |
| - | assert page = CmsPage.find_by_slug('test_page') |
| - | assert_equal 'Test Header', page.cms_block_content(:header, :content_string) |
| - | assert_equal 'Test Content', page.cms_block_content(:default, :content_text) |
| - | assert_equal 'Test Footer', page.cms_block_content(:footer, :content_text) |
| - | end |
| - | end |
| - | end |
| - | |
| - | def test_update |
| - | page = cms_pages(:complex) |
| - | |
| - | assert_difference 'CmsBlock.count' do |
| - | put :update, :id => page, :cms_page => { |
| - | :label => 'New Test Page', |
| - | :slug => 'new_test_page', |
| - | :cms_layout => cms_layouts(:default), |
| - | :blocks => { |
| - | :header => { :content_string => 'New Test Header' }, |
| - | :default => { :content_text => 'New Test Content' }, |
| - | :footer => { :content_text => 'New Test Footer' } |
| - | } |
| - | } |
| - | assert_response :redirect |
| - | assert_redirected_to edit_cms_admin_page_path(assigns(:cms_page)) |
| - | assert_equal 'Page updated', flash[:notice] |
| - | |
| - | assert page = CmsPage.find_by_slug('new_test_page') |
| - | assert_equal 'New Test Header', page.cms_block_content(:header, :content_string) |
| - | assert_equal 'New Test Content', page.cms_block_content(:default, :content_text) |
| - | assert_equal 'New Test Footer', page.cms_block_content(:footer, :content_text) |
| - | |
| - | # old blocks are still there: |
| - | assert !page.cms_block_content(:left_column, :content_text).blank? |
| - | assert !page.cms_block_content(:right_column, :content_text).blank? |
| - | end |
| - | end |
| - | |
| - | def test_destroy |
| - | page = cms_pages(:default) |
| - | |
| - | assert_difference 'CmsPage.count', -7 do |
| - | assert_difference 'CmsBlock.count', -7 do |
| - | delete :destroy, :id => page |
| - | assert_response :redirect |
| - | assert_redirected_to cms_admin_pages_path |
| - | assert_equal 'Page removed', flash[:notice] |
| - | end |
| - | end |
| - | end |
| - | |
| - | def test_preview_for_create |
| - | assert_no_difference 'CmsPage.count' do |
| - | assert_no_difference 'CmsBlock.count' do |
| - | post :create, :preview => 'Preview Button', :cms_page => { |
| - | :label => 'Test Page', |
| - | :slug => 'test_page', |
| - | :cms_layout => cms_layouts(:default), |
| - | :blocks => { |
| - | :header => { :content_string => 'Test Header' }, |
| - | :default => { :content_text => 'Test Content' }, |
| - | :footer => { :content_text => 'Test Footer' } |
| - | } |
| - | } |
| - | assert_response :success |
| - | end |
| - | end |
| - | end |
| - | |
| - | def test_preview_for_update |
| - | page = cms_pages(:complex) |
| - | |
| - | assert_no_difference 'CmsBlock.count' do |
| - | put :update, :preview => 'Preview Button', :id => page, :cms_page => { |
| - | :label => 'New Test Page', |
| - | :slug => 'new_test_page', |
| - | :cms_layout => cms_layouts(:default), |
| - | :blocks => { |
| - | :header => { :content_string => 'New Test Header' }, |
| - | :default => { :content_text => 'New Test Content' }, |
| - | :footer => { :content_text => 'New Test Footer' } |
| - | } |
| - | } |
| - | assert_response :success |
| - | end |
| - | end |
| - | |
| - | def test_toggle |
| - | assert !session[:cms_page] |
| - | # Expand |
| - | post :toggle, :id => cms_pages(:default) |
| - | assert session[:cms_page].include?(cms_pages(:default).id) |
| - | # Collapse |
| - | post :toggle, :id => cms_pages(:default) |
| - | assert !session[:cms_page].include?(cms_pages(:default).id) |
| - | end |
| - | end |
| + | end |
| \ No newline at end of file | |
test/functional/cms_admin/snippets_controller_test.rb
+3
-57
| @@ | @@ -2,62 +2,8 @@ require File.dirname(__FILE__) + '/../../test_helper' |
| class CmsAdmin::SnippetsControllerTest < ActionController::TestCase | |
| - | def setup |
| - | http_auth |
| + | def test_something |
| + | flunk |
| end | |
| - | def test_get_index |
| - | get :index |
| - | assert_response :success |
| - | assert assigns(:cms_snippets) |
| - | end |
| - | |
| - | def test_get_new |
| - | get :new |
| - | assert_response :success |
| - | end |
| - | |
| - | def test_get_edit |
| - | get :edit, :id => cms_snippets(:default) |
| - | assert_response :success |
| - | assert assigns(:cms_snippet) |
| - | end |
| - | |
| - | def test_create |
| - | assert_difference 'CmsSnippet.count' do |
| - | post :create, :cms_snippet => { |
| - | :label => 'test_snippet', |
| - | :content => 'test content' |
| - | } |
| - | assert_response :redirect |
| - | assert_redirected_to edit_cms_admin_snippet_path(assigns(:cms_snippet)) |
| - | assert_equal 'Snippet created', flash[:notice] |
| - | end |
| - | end |
| - | |
| - | def test_update |
| - | snippet = cms_snippets(:default) |
| - | |
| - | put :update, :id => snippet, :cms_snippet => { |
| - | :label => 'new_test_label', |
| - | :content => 'new test content' |
| - | } |
| - | assert_response :redirect |
| - | assert_redirected_to edit_cms_admin_snippet_path(assigns(:cms_snippet)) |
| - | assert_equal 'Snippet updated', flash[:notice] |
| - | |
| - | snippet.reload |
| - | assert_equal 'new_test_label', snippet.label |
| - | assert_equal 'new test content', snippet.content |
| - | end |
| - | |
| - | def test_destroy |
| - | assert_difference 'CmsSnippet.count', -1 do |
| - | delete :destroy, :id => cms_snippets(:default) |
| - | assert_response :redirect |
| - | assert_redirected_to cms_admin_snippets_path |
| - | assert_equal 'Snippet removed', flash[:notice] |
| - | end |
| - | end |
| - | |
| - | end |
| + | end |
| \ No newline at end of file | |
test/functional/cms_content_controller_test.rb
+4
-41
| @@ | @@ -1,46 +1,9 @@ |
| - | require 'test_helper' |
| + | require File.dirname(__FILE__) + '/../test_helper' |
| class CmsContentControllerTest < ActionController::TestCase | |
| - | def test_get_a_page |
| - | assert cms_pages(:complex).published? |
| - | get :show, :path => %w(complex-page) |
| - | assert_response :success |
| - | assert assigns(:cms_page) |
| - | end |
| - | |
| - | def test_get_a_unpublished_page |
| - | assert !cms_pages(:unpublished).published? |
| - | get :show, :path => %w(unpublished) |
| - | assert_response 404 |
| - | end |
| - | |
| - | def test_get_sitemap |
| - | get :sitemap, :format => 'xml' |
| - | assert_response :success |
| - | assert assigns(:cms_pages) |
| - | end |
| - | |
| - | def test_default_404_page |
| - | get :show, :path => %w(some non existing page) |
| - | assert_response 404 |
| - | assert !assigns(:cms_page) |
| - | end |
| - | |
| - | def test_custom_404_page |
| - | cms_page = CmsPage.create!( |
| - | :cms_layout => cms_layouts(:default), |
| - | :label => '404 Page', |
| - | :slug => '404', |
| - | :published => true |
| - | ) |
| - | get :show, :path => %w(some non existing page) |
| - | assert_response 404 |
| - | assert assigns(:cms_page) |
| - | end |
| - | |
| - | def test_get_page_with_extension |
| - | get :show, :path => %w(path to somepage.php?show=1) |
| - | assert_response 404 |
| + | def test_something |
| + | flunk |
| end | |
| + | |
| end | |
test/performance/browsing_test.rb
+0
-9
| @@ | @@ -1,9 +0,0 @@ |
| - | require 'test_helper' |
| - | require 'rails/performance_test_help' |
| - | |
| - | # Profiling results for each test method are written to tmp/performance. |
| - | class BrowsingTest < ActionDispatch::PerformanceTest |
| - | def test_homepage |
| - | get '/' |
| - | end |
| - | end |
test/unit/cms_asset_test.rb
+9
-0
| @@ | @@ -0,0 +1,9 @@ |
| + | require File.dirname(__FILE__) + '/../test_helper' |
| + | |
| + | class CmsAssetTest < ActiveSupport::TestCase |
| + | |
| + | def test_something |
| + | flunk |
| + | end |
| + | |
| + | end |
test/unit/cms_page_test.rb
+0
-7
| @@ | @@ -11,11 +11,4 @@ class CmsPageTest < ActiveSupport::TestCase |
| ].join("\n"), page.render_content | |
| end | |
| - | def test_method_layout_content |
| - | page = cms_pages(:default) |
| - | assert_equal page.cms_layout.content, (content = page.send(:layout_content)) |
| - | content = 'new content' |
| - | assert_not_equal page.cms_layout.content, content |
| - | end |
| - | |
| end | |