Permalink
Browse files

Change Factory(:class) calls to FactoryGirl.create(:class)

* Remove deprecation warnings for FactoryGirl 2.x+
  • Loading branch information...
1 parent 3e1b0d1 commit 45f11394ab7a29163977a50f14c3b354056835bd Dave Worth committed Jun 14, 2012
@@ -4,8 +4,8 @@
describe "two equal entities" do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
end
describe "message sending" do
@@ -190,8 +190,8 @@
describe "two different entities" do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:duck)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:duck)
end
describe "message sending" do
@@ -352,9 +352,9 @@
describe "three equal entities" do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
- @entity3 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
+ @entity3 = FactoryGirl.create(:user)
@recipients = Array.new
@recipients << @entity2
@recipients << @entity3
@@ -534,9 +534,9 @@
describe "three different entities" do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:duck)
- @entity3 = Factory(:cylon)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:duck)
+ @entity3 = FactoryGirl.create(:cylon)
@recipients = Array.new
@recipients << @entity2
@recipients << @entity3
@@ -3,10 +3,10 @@
describe MessageMailer do
describe "when sending new message" do
before do
- @sender = Factory(:user)
- @entity1 = Factory(:user)
- @entity2 = Factory(:duck)
- @entity3 = Factory(:cylon)
+ @sender = FactoryGirl.create(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:duck)
+ @entity3 = FactoryGirl.create(:cylon)
@receipt1 = @sender.send_message([@entity1,@entity2,@entity3], "Body Body Body Body Body Body Body Body Body Body Body Body","Subject")
end
@@ -48,10 +48,10 @@
describe "when replying" do
before do
- @sender = Factory(:user)
- @entity1 = Factory(:user)
- @entity2 = Factory(:duck)
- @entity3 = Factory(:cylon)
+ @sender = FactoryGirl.create(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:duck)
+ @entity3 = FactoryGirl.create(:cylon)
@receipt1 = @sender.send_message([@entity1,@entity2,@entity3], "Body","Subject")
@receipt2 = @sender.reply_to_all(@receipt1, "Body")
end
@@ -2,9 +2,9 @@
describe NotificationMailer do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:duck)
- @entity3 = Factory(:cylon)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:duck)
+ @entity3 = FactoryGirl.create(:cylon)
@receipt1 = Notification.notify_all([@entity1,@entity2,@entity3],"Subject", "Body Body Body Body Body Body Body Body Body Body Body Body")
end
@@ -3,8 +3,8 @@
describe Conversation do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
@receipt1 = @entity1.send_message(@entity2,"Body","Subject")
@receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
@receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
@@ -47,7 +47,7 @@
end
describe "scopes" do
- let(:participant) { Factory(:user) }
+ let(:participant) { FactoryGirl.create(:user) }
let!(:inbox_conversation) { @entity1.send_message(participant, "Body", "Subject").notification.conversation }
let!(:sentbox_conversation) { participant.send_message(@entity1, "Body", "Subject").notification.conversation }
@@ -3,8 +3,8 @@
describe Mailbox do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
@receipt1 = @entity1.send_message(@entity2,"Body","Subject")
@receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
@receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
@@ -3,8 +3,8 @@
describe "Mailboxer::Models::Messageable through User" do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
end
it "should have a mailbox" do
@@ -3,8 +3,8 @@
describe Message do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
@receipt1 = @entity1.send_message(@entity2,"Body","Subject")
@receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
@receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
@@ -3,9 +3,9 @@
describe Message do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
- @entity3 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
+ @entity3 = FactoryGirl.create(:user)
end
it "should notify one user" do
@@ -3,8 +3,8 @@
describe Receipt do
before do
- @entity1 = Factory(:user)
- @entity2 = Factory(:user)
+ @entity1 = FactoryGirl.create(:user)
+ @entity2 = FactoryGirl.create(:user)
@mail1 = @entity1.send_message(@entity2,"Body","Subject")
end

0 comments on commit 45f1139

Please sign in to comment.