test/support/factories.rb in alondra-0.0.4 vs test/support/factories.rb in alondra-0.1.0

- old
+ new

@@ -1,19 +1,21 @@ -Factory.define :chat do |f| - f.name 'Test chat' -end +FactoryGirl.define do + factory :chat do + name 'Test chat' + end -Factory.define :message do |f| - f.association :chat - f.text 'Test message' -end + factory :message do + association :chat + text 'Test message' + end -Factory.sequence :username do |i| - "user#{i}" -end + sequence :username do |i| + "user#{i}" + end -Factory.define :user do |f| - f.username { Factory.next(:username) } - f.email { |u| "#{u.username}@example.com" } - f.password 'secret' - f.password_confirmation 'secret' + factory :user do + username { FactoryGirl.generate(:username) } + email { |u| "#{u.username}@example.com" } + password 'secret' + password_confirmation 'secret' + end end \ No newline at end of file