Invitations and requests importing
This commit is contained in:
parent
52f1ce81fb
commit
47ed820dea
1 changed files with 9 additions and 10 deletions
|
|
@ -128,24 +128,22 @@ describe DataConversion::ImportToMysql do
|
||||||
it "imports data into the mongo_invitations table" do
|
it "imports data into the mongo_invitations table" do
|
||||||
Mongo::Invitation.count.should == 1
|
Mongo::Invitation.count.should == 1
|
||||||
Invitation.count.should == 0
|
Invitation.count.should == 0
|
||||||
@migrator.import_raw_invitations
|
@migrator.process_raw_invitations
|
||||||
Invitation.count.should == 1
|
Invitation.count.should == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
it "imports all the columns" do
|
it "imports all the columns" do
|
||||||
@migrator.process_raw_invitations
|
@migrator.process_raw_invitations
|
||||||
invitation = Mongo::Invitation.first
|
invitation = Invitation.first
|
||||||
invitation.mongo_id.should == "4d2657fdcc8cb46033000022"
|
invitation.mongo_id.should == "4d2657fdcc8cb46033000022"
|
||||||
invitation.recipient_mongo_id.should =="4d2657fbcc8cb46033000021"
|
|
||||||
invitation.sender_mongo_id.should == "4d2657e9cc8cb46033000005"
|
|
||||||
invitation.aspect_mongo_id.should == '4d2657e9cc8cb46033000006'
|
|
||||||
invitation.message.should == "Hello!"
|
invitation.message.should == "Hello!"
|
||||||
end
|
end
|
||||||
it 'sets the relation columns' do
|
it 'sets the relation columns' do
|
||||||
@migrator.process_raw_invitations
|
@migrator.process_raw_invitations
|
||||||
invitation = Invitation.first
|
invitation = Invitation.first
|
||||||
invitation.sender_id.should == User.where(:mongo_id => invitation.sender_mongo_id).first.id
|
mongo_invitation = Mongo::Invitation.where(:mongo_id => invitation.mongo_id).first
|
||||||
invitation.recipient_id.should == User.where(:mongo_id => invitation.recipient_mongo_id).first.id
|
invitation.sender_id.should == User.where(:mongo_id => mongo_invitation.sender_mongo_id).first.id
|
||||||
|
invitation.recipient_id.should == User.where(:mongo_id => mongo_invitation.recipient_mongo_id).first.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe "requests" do
|
describe "requests" do
|
||||||
|
|
@ -166,7 +164,7 @@ describe DataConversion::ImportToMysql do
|
||||||
it "imports data into the mongo_requests table" do
|
it "imports data into the mongo_requests table" do
|
||||||
Mongo::Request.count.should == 2
|
Mongo::Request.count.should == 2
|
||||||
Request.count.should == 0
|
Request.count.should == 0
|
||||||
@migrator.import_raw_requests
|
@migrator.process_raw_requests
|
||||||
Request.count.should == 2
|
Request.count.should == 2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -178,8 +176,9 @@ describe DataConversion::ImportToMysql do
|
||||||
it 'sets the relation columns' do
|
it 'sets the relation columns' do
|
||||||
@migrator.process_raw_requests
|
@migrator.process_raw_requests
|
||||||
request = Request.first
|
request = Request.first
|
||||||
request.sender_id.should == Person.where(:mongo_id => request.sender_mongo_id).first.id
|
mongo_request = Mongo::Request.where(:mongo_id => request.mongo_id).first
|
||||||
request.recipient_id.should == Person.where(:mongo_id => request.recipient_mongo_id).first.id
|
request.sender_id.should == Person.where(:mongo_id => mongo_request.sender_mongo_id).first.id
|
||||||
|
request.recipient_id.should == Person.where(:mongo_id => mongo_request.recipient_mongo_id).first.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe "people" do
|
describe "people" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue