Sha256: 18f4d6ec9d42f69af0eb5e9149f25b58cd7e3c84a9cb55fe2c8e314a83365efe
Contents?: true
Size: 685 Bytes
Versions: 45
Compression:
Stored size: 685 Bytes
Contents
require 'spec_helper' require 'classiccms/application' require 'classiccms/cli' describe 'Image' do def app Classiccms.boot Classiccms::WebsiteController end before :all do clear_tmp discard { Classiccms::Cli.command ['new', 'app'] } Dir.chdir 'app' app end it 'should upload an image' do image = Image.new image.file = File.open(File.join(File.dirname(__FILE__),'/../../spec/assets/cat.jpg')) image.save image.file.size.should == 34503 end it 'should only accept images' do image = Image.new image.file = File.open(File.join(File.dirname(__FILE__),'/../../spec/assets/cat.txt')) image.save.should == false end end
Version data entries
45 entries across 45 versions & 1 rubygems