Sha256: 6adfdb26903f409c56ddf718b40b98ff4617cc9e525660937051956742e2c286

Contents?: true

Size: 903 Bytes

Versions: 4

Compression:

Stored size: 903 Bytes

Contents

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

describe Lolita::Configuration::FilesTab do

  let(:dbi){Lolita::DBI::Base.new(Post)}
  let(:tab){Lolita::Configuration::FilesTab.new(dbi)}

  it "should create new file tab" do
    Lolita::Configuration::FilesTab.new(dbi).type.should == :files
  end

  describe "extensions" do

    it "should return empty array for new tab" do
      tab.extensions.should == []
    end 

    it "all can be assigned" do
      tab.extensions=["pdf","xls"]
      tab.extensions.should == ["pdf", "xls"]
    end

    it "should allow to add new one" do
      tab.extension("pdf")
      tab.extensions.should == ["pdf"]
    end
  end

  describe "maximum file size" do
    it "should be changable" do
      tab.maxfilesize=2048
      tab.maxfilesize.should == 2048
      tab.maxfilesize(1024)
      tab.maxfilesize.should == 1024
    end
  end 
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lolita-file-upload-0.1.3 spec/configuration/tab/files_spec.rb
lolita-file-upload-0.1.2 spec/configuration/tab/files_spec.rb
lolita-file-upload-0.1.1 spec/configuration/tab/files_spec.rb
lolita-file-upload-0.1.0 spec/configuration/tab/files_spec.rb