Skip to content

Commit

Permalink
Merge branch 'big-letters-in-factory-name' of https://github.com/morg…
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-burns committed Nov 16, 2011
2 parents 1ad3a63 + 3337196 commit 463028d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/factory_girl/factory.rb
Expand Up @@ -7,7 +7,7 @@ class Factory

def initialize(name, options = {}) #:nodoc:
assert_valid_options(options)
@name = name.to_s.underscore.to_sym
@name = name.is_a?(Symbol) ? name : name.to_s.underscore.to_sym
@parent = options[:parent]
@aliases = options[:aliases] || []
@class_name = options[:class]
Expand Down
6 changes: 6 additions & 0 deletions spec/factory_girl/factory_spec.rb
Expand Up @@ -229,6 +229,12 @@
its(:human_names) { should == ["happy user"] }
end

context "factory name with big letters" do
subject { FactoryGirl::Factory.new(:LoL) }
its(:names) { should == [:LoL] }
its(:human_names) { should == ["lol"] }
end

context "factory name with aliases" do
subject { FactoryGirl::Factory.new(:happy_user, :aliases => [:gleeful_user, :person]) }
its(:names) { should == [:happy_user, :gleeful_user, :person] }
Expand Down

0 comments on commit 463028d

Please sign in to comment.