Sha256: ed37f5fe068f1810f45a818eecfd21aa4b4ddcbe520846e07a229ce997c7df36

Contents?: true

Size: 1.48 KB

Versions: 10

Compression:

Stored size: 1.48 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'

class DefaultControllerTest < ActionController::TestCase

  tests DefaultController

  context "default controller" do
    
    context 'on GET to index' do
      # The default view calls the upload_form helper.  This isn't a great test but
      # it will make sure it doesn't blow up
      setup do
        @user = Factory(:user)
        get :index, :user_id => @user.to_param
      end
      should respond_with :success
      should "have a_container_with_a_long_name in the body" do
        assert @response.body.include?('a_container_with_a_long_name')
      end
      should "have '1 MB' in the body" do
        assert @response.body.include?('1 MB')
      end
      should "have '*.jpg' in the body" do
        assert @response.body.include?('*.jpg')
      end
    end

    context 'on GET to uploadify' do
      # The default view calls the upload_form helper.  This isn't a great test but
      # it will make sure it doesn't blow up
      setup do
        @user = Factory(:user)
        get :uploadify, :user_id => @user.to_param
      end
      should respond_with :success
      should "have a_container_with_a_long_name in the body" do
        assert @response.body.include?('a_container_with_a_long_name')
      end
      should "have '1310720' in the body" do
        assert @response.body.include?('1310720')
      end
      should "have '*.jpg' in the body" do
        assert @response.body.include?('*.jpg')
      end
    end
    
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
uploader-3.1.0 test/rails_test/test/functional/default_controller_test.rb
uploader-3.0.2 test/rails_test/test/functional/default_controller_test.rb
uploader-3.0.1 test/rails_test/test/functional/default_controller_test.rb
uploader-3.0.0 test/rails_test/test/functional/default_controller_test.rb
uploader-2.0.2 test/rails_root/test/functional/default_controller_test.rb
uploader-2.0.0 test/rails_root/test/functional/default_controller_test.rb
uploader-1.0.3 test/rails_root/test/functional/default_controller_test.rb
uploader-1.0.2 test/rails_root/test/functional/default_controller_test.rb
uploader-1.0.1 test/rails_root/test/functional/default_controller_test.rb
uploader-1.0.0 test/rails_root/test/functional/default_controller_test.rb