Skip to content

Commit

Permalink
Merge pull request #1746 from Bonias/fix-mounter-blank-method
Browse files Browse the repository at this point in the history
Fix `Mounter.blank?` method
  • Loading branch information
bensie committed Nov 27, 2015
2 parents 5217412 + 8f0539c commit a8ee3f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/carrierwave/mounter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def urls(*args)
end

def blank?
uploaders.empty?
uploaders.none?(&:present?)
end

def remove?
Expand Down
4 changes: 2 additions & 2 deletions spec/mount_multiple_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ def monkey
describe '#images?' do

it "should be false when nothing has been assigned" do
expect(@instance).to receive(:read_uploader).with(:images).and_return(nil)
@instance.images = nil
expect(@instance.images?).to be_falsey
end

it "should be false when an empty string has been assigned" do
expect(@instance).to receive(:read_uploader).with(:images).and_return('')
@instance.images = ''
expect(@instance.images?).to be_falsey
end

Expand Down
4 changes: 2 additions & 2 deletions spec/mount_single_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ def monkey
describe '#image?' do

it "should be false when nothing has been assigned" do
expect(@instance).to receive(:read_uploader).with(:image).and_return(nil)
@instance.image = nil
expect(@instance.image?).to be_falsey
end

it "should be false when an empty string has been assigned" do
expect(@instance).to receive(:read_uploader).with(:image).and_return('')
@instance.image = ''
expect(@instance.image?).to be_falsey
end

Expand Down

0 comments on commit a8ee3f3

Please sign in to comment.