Fixed User.current test warnings

pull/6827/head
Sebastian Schuster 11 years ago
parent 24d728673a
commit 587f1d26f7
  1. 8
      spec/models/user_deletion_spec.rb

@ -40,13 +40,13 @@ describe User, "#destroy" do
shared_examples_for "updated journalized associated object" do
before do
User.current = user2
User.stub(:current).and_return(user2)
associations.each do |association|
associated_instance.send(association.to_s + "=", user2)
end
associated_instance.save!
User.current = user # in order to have the content journal created by the user
User.stub(:current).and_return(user) # in order to have the content journal created by the user
associated_instance.reload
associations.each do |association|
associated_instance.send(association.to_s + "=", user)
@ -79,13 +79,13 @@ describe User, "#destroy" do
shared_examples_for "created journalized associated object" do
before do
User.current = user # in order to have the content journal created by the user
User.stub(:current).and_return(user) # in order to have the content journal created by the user
associations.each do |association|
associated_instance.send(association.to_s + "=", user)
end
associated_instance.save!
User.current = user2
User.stub(:current).and_return(user2)
associated_instance.reload
associations.each do |association|
associated_instance.send(association.to_s + "=", user2)

Loading…
Cancel
Save