Sha256: dbcbaaceccfb5e35dd923125184f6c3776e70a55c19596c01f1d5caab3eda2ef

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 KB

Contents

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

describe DefaultController do
  
  render_views
      
  describe '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
    before do
      @user = Factory(:user)
      get :index, :user_id => @user.to_param
    end
    it { should respond_with :success }
    it "should have a_container_with_a_long_name in the body" do
      @response.body.should include('a_container_with_a_long_name')
    end
    it "should have '1 MB' in the body" do
      @response.body.should include('1 MB')
    end
    it "should have '*.jpg' in the body" do
      @response.body.should include('*.jpg')
    end
  end

  describe '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
    before do
      @user = Factory(:user)
      get :uploadify, :user_id => @user.to_param
    end
    it { should respond_with :success }
    it "should have a_container_with_a_long_name in the body" do
      @response.body.should include('a_container_with_a_long_name')
    end
    it "should have '1310720' in the body" do
      @response.body.should include('1310720')
    end
    it "should have '*.jpg' in the body" do
      @response.body.should include('*.jpg')
    end
  end
    
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
uploader-3.1.4 test/rails_test/spec/controllers/default_controller_spec.rb
uploader-3.1.3 test/rails_test/spec/controllers/default_controller_spec.rb
uploader-3.1.2 test/rails_test/spec/controllers/default_controller_spec.rb
uploader-3.1.1 test/rails_test/spec/controllers/default_controller_spec.rb