Skip to content

Commit

Permalink
Change Factory(:class) calls to FactoryGirl.create(:class)
Browse files Browse the repository at this point in the history
* Remove deprecation warnings for FactoryGirl 2.x+
  • Loading branch information
Dave Worth committed Jun 14, 2012
1 parent 3e1b0d1 commit 45f1139
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
20 changes: 10 additions & 10 deletions spec/integration/message_and_receipt_spec.rb
Expand Up @@ -4,8 +4,8 @@


describe "two equal entities" do describe "two equal entities" do
before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
end end


describe "message sending" do describe "message sending" do
Expand Down Expand Up @@ -190,8 +190,8 @@


describe "two different entities" do describe "two different entities" do
before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:duck) @entity2 = FactoryGirl.create(:duck)
end end


describe "message sending" do describe "message sending" do
Expand Down Expand Up @@ -352,9 +352,9 @@


describe "three equal entities" do describe "three equal entities" do
before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
@entity3 = Factory(:user) @entity3 = FactoryGirl.create(:user)
@recipients = Array.new @recipients = Array.new
@recipients << @entity2 @recipients << @entity2
@recipients << @entity3 @recipients << @entity3
Expand Down Expand Up @@ -534,9 +534,9 @@


describe "three different entities" do describe "three different entities" do
before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:duck) @entity2 = FactoryGirl.create(:duck)
@entity3 = Factory(:cylon) @entity3 = FactoryGirl.create(:cylon)
@recipients = Array.new @recipients = Array.new
@recipients << @entity2 @recipients << @entity2
@recipients << @entity3 @recipients << @entity3
Expand Down
16 changes: 8 additions & 8 deletions spec/mailers/message_mailer_spec.rb
Expand Up @@ -3,10 +3,10 @@
describe MessageMailer do describe MessageMailer do
describe "when sending new message" do describe "when sending new message" do
before do before do
@sender = Factory(:user) @sender = FactoryGirl.create(:user)
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:duck) @entity2 = FactoryGirl.create(:duck)
@entity3 = Factory(:cylon) @entity3 = FactoryGirl.create(:cylon)
@receipt1 = @sender.send_message([@entity1,@entity2,@entity3], "Body Body Body Body Body Body Body Body Body Body Body Body","Subject") @receipt1 = @sender.send_message([@entity1,@entity2,@entity3], "Body Body Body Body Body Body Body Body Body Body Body Body","Subject")
end end


Expand Down Expand Up @@ -48,10 +48,10 @@


describe "when replying" do describe "when replying" do
before do before do
@sender = Factory(:user) @sender = FactoryGirl.create(:user)
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:duck) @entity2 = FactoryGirl.create(:duck)
@entity3 = Factory(:cylon) @entity3 = FactoryGirl.create(:cylon)
@receipt1 = @sender.send_message([@entity1,@entity2,@entity3], "Body","Subject") @receipt1 = @sender.send_message([@entity1,@entity2,@entity3], "Body","Subject")
@receipt2 = @sender.reply_to_all(@receipt1, "Body") @receipt2 = @sender.reply_to_all(@receipt1, "Body")
end end
Expand Down
6 changes: 3 additions & 3 deletions spec/mailers/notification_mailer_spec.rb
Expand Up @@ -2,9 +2,9 @@


describe NotificationMailer do describe NotificationMailer do
before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:duck) @entity2 = FactoryGirl.create(:duck)
@entity3 = Factory(:cylon) @entity3 = FactoryGirl.create(:cylon)
@receipt1 = Notification.notify_all([@entity1,@entity2,@entity3],"Subject", "Body Body Body Body Body Body Body Body Body Body Body Body") @receipt1 = Notification.notify_all([@entity1,@entity2,@entity3],"Subject", "Body Body Body Body Body Body Body Body Body Body Body Body")
end end


Expand Down
6 changes: 3 additions & 3 deletions spec/models/conversation_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe Conversation do describe Conversation do


before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
@receipt1 = @entity1.send_message(@entity2,"Body","Subject") @receipt1 = @entity1.send_message(@entity2,"Body","Subject")
@receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1") @receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
@receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2") @receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
Expand Down Expand Up @@ -47,7 +47,7 @@
end end


describe "scopes" do describe "scopes" do
let(:participant) { Factory(:user) } let(:participant) { FactoryGirl.create(:user) }
let!(:inbox_conversation) { @entity1.send_message(participant, "Body", "Subject").notification.conversation } let!(:inbox_conversation) { @entity1.send_message(participant, "Body", "Subject").notification.conversation }
let!(:sentbox_conversation) { participant.send_message(@entity1, "Body", "Subject").notification.conversation } let!(:sentbox_conversation) { participant.send_message(@entity1, "Body", "Subject").notification.conversation }


Expand Down
4 changes: 2 additions & 2 deletions spec/models/mailbox_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe Mailbox do describe Mailbox do


before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
@receipt1 = @entity1.send_message(@entity2,"Body","Subject") @receipt1 = @entity1.send_message(@entity2,"Body","Subject")
@receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1") @receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
@receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2") @receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
Expand Down
4 changes: 2 additions & 2 deletions spec/models/mailboxer_models_messageable_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe "Mailboxer::Models::Messageable through User" do describe "Mailboxer::Models::Messageable through User" do


before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
end end


it "should have a mailbox" do it "should have a mailbox" do
Expand Down
4 changes: 2 additions & 2 deletions spec/models/message_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe Message do describe Message do


before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
@receipt1 = @entity1.send_message(@entity2,"Body","Subject") @receipt1 = @entity1.send_message(@entity2,"Body","Subject")
@receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1") @receipt2 = @entity2.reply_to_all(@receipt1,"Reply body 1")
@receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2") @receipt3 = @entity1.reply_to_all(@receipt2,"Reply body 2")
Expand Down
6 changes: 3 additions & 3 deletions spec/models/notification_spec.rb
Expand Up @@ -3,9 +3,9 @@
describe Message do describe Message do


before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
@entity3 = Factory(:user) @entity3 = FactoryGirl.create(:user)
end end


it "should notify one user" do it "should notify one user" do
Expand Down
4 changes: 2 additions & 2 deletions spec/models/receipt_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe Receipt do describe Receipt do


before do before do
@entity1 = Factory(:user) @entity1 = FactoryGirl.create(:user)
@entity2 = Factory(:user) @entity2 = FactoryGirl.create(:user)
@mail1 = @entity1.send_message(@entity2,"Body","Subject") @mail1 = @entity1.send_message(@entity2,"Body","Subject")
end end


Expand Down

0 comments on commit 45f1139

Please sign in to comment.