Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/account_migration_spec.rb')
-rw-r--r--spec/integration/account_migration_spec.rb41
1 files changed, 34 insertions, 7 deletions
diff --git a/spec/integration/account_migration_spec.rb b/spec/integration/account_migration_spec.rb
index 35597edad..17beba199 100644
--- a/spec/integration/account_migration_spec.rb
+++ b/spec/integration/account_migration_spec.rb
@@ -97,9 +97,29 @@ shared_examples_for "migration scenarios initiated locally" do
[]
end
- inlined_jobs do
- run_migration
- end
+ inlined_jobs { run_migration }
+ end
+
+ it "does not change the remote paths" do
+ photo = FactoryGirl.create(:photo, author: old_person)
+ remote_photo_path = photo.remote_photo_path
+
+ run_migration
+
+ expect(photo.reload.remote_photo_path).to eq(remote_photo_path)
+ end
+end
+
+shared_examples_for "remote photo migration" do
+ it "changes the remote paths of photos of the old person" do
+ old_photo = FactoryGirl.create(:photo, author: old_person)
+ new_photo = FactoryGirl.create(:photo, author: new_person)
+ new_remote_photo_path = old_photo.remote_photo_path
+
+ run_migration
+
+ expect(old_photo.reload.remote_photo_path).to eq("https://diaspora.example.tld/uploads/images/")
+ expect(new_photo.reload.remote_photo_path).to eq(new_remote_photo_path)
end
end
@@ -125,6 +145,8 @@ describe "account migration" do
include_examples "every migration scenario"
include_examples "migration scenarios initiated remotely"
+
+ include_examples "remote photo migration"
end
# this is the case when we're a pod, which was left by a person in favor of remote one
@@ -136,6 +158,8 @@ describe "account migration" do
include_examples "migration scenarios initiated remotely"
+ include_examples "remote photo migration"
+
it_behaves_like "migration scenarios with local old user"
it_behaves_like "deletes all of the user data" do
@@ -165,9 +189,10 @@ describe "account migration" do
def run_migration
AccountMigration.create!(
- old_person: old_user.person,
- new_person: new_user.person,
- old_private_key: old_user.serialized_private_key
+ old_person: old_user.person,
+ new_person: new_user.person,
+ old_private_key: old_user.serialized_private_key,
+ remote_photo_path: "https://diaspora.example.tld/uploads/images/"
).perform!
end
@@ -184,7 +209,9 @@ describe "account migration" do
include_context "with local new user"
def run_migration
- AccountMigration.create!(old_person: old_user.person, new_person: new_user.person).perform!
+ AccountMigration.create!(old_person: old_user.person,
+ new_person: new_user.person,
+ remote_photo_path: "https://diaspora.example.tld/uploads/images/").perform!
end
include_examples "every migration scenario"