spec/orm/sequel_spec.rb in jnicklas-carrierwave-0.3.1 vs spec/orm/sequel_spec.rb in jnicklas-carrierwave-0.3.2
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
require File.dirname(__FILE__) + '/../spec_helper'
require 'carrierwave/orm/sequel'
DB = Sequel.sqlite
@@ -25,23 +27,25 @@
after(:all) do
DB.drop_table :events
end
- before do
+ before(:each) do
@class = Class.new(Sequel::Model)
@class.set_dataset :events
@class, @uploader, @event = setup_variables_for_class(@class)
end
+
+ after(:each) { @class.delete }
describe '#image' do
- it "should return nil when nothing has been assigned" do
+ it "should return blank uploader when nothing has been assigned" do
@event.image.should be_blank
end
- it "should return nil when an empty string has been assigned" do
+ it "should return blank uploader when an empty string has been assigned" do
@event[:image] = ''
@event.save
@event.reload
@event.image.should be_blank
end
@@ -85,10 +89,10 @@
it "should do nothing when an empty string is assigned" do
@event.image = ''
@event.image.should be_blank
end
-
+
end
describe '#save' do
it "should do nothing when no file has been assigned" do