Skip to content

Commit

Permalink
Change slash handling in folder names
Browse files Browse the repository at this point in the history
  • Loading branch information
reagent committed Sep 26, 2010
1 parent 99633b9 commit 921e847
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fleakr/objects/set.rb
Expand Up @@ -52,7 +52,7 @@ def file_prefix(index) # :nodoc:
end

def folder_name # :nodoc:
title.gsub("/", '')
title.gsub("/", ' ').squeeze(' ')
end

# Primary photo for this set. See Fleakr::Objects::Photo for more details.
Expand Down
9 changes: 8 additions & 1 deletion test/unit/fleakr/objects/set_test.rb
Expand Up @@ -90,7 +90,14 @@ class SetTest < Test::Unit::TestCase
set = Set.new
set.stubs(:title).with().returns("This/That")

set.folder_name.should == 'ThisThat'
set.folder_name.should == 'This That'
end

should "collapse spaces when generating the folder name" do
set = Set.new
set.stubs(:title).with().returns('This / That')

set.folder_name.should == 'This That'
end

context "when saving the set" do
Expand Down

0 comments on commit 921e847

Please sign in to comment.