Skip to content

Commit

Permalink
Updated specs to use FactoryGirl.create instead of the depricated met…
Browse files Browse the repository at this point in the history
…hod Factory
  • Loading branch information
carolyncole committed May 22, 2012
1 parent d8a40ae commit fb28adf
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions spec/mailers/message_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/mailers/notification_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions spec/models/conversation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 }

Expand Down
4 changes: 2 additions & 2 deletions spec/models/mailbox_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions spec/models/mailboxer_models_messageable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/models/message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions spec/models/notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/models/receipt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fb28adf

Please sign in to comment.