Tests now pass
This commit is contained in:
parent
d3022b46ba
commit
d8ad4367d5
4 changed files with 20 additions and 3 deletions
|
|
@ -56,6 +56,7 @@ class User < Person
|
|||
end
|
||||
|
||||
def receive_friend_request(friend_request)
|
||||
puts friend_request.inspect
|
||||
Rails.logger.info("receiving friend request #{friend_request.to_json}")
|
||||
GPGME.import(friend_request.exported_key)
|
||||
if Request.where(:callback_url => friend_request.callback_url).first
|
||||
|
|
|
|||
|
|
@ -127,8 +127,8 @@ describe "parser in application helper" do
|
|||
|
||||
it "should activate the Person if I initiated a request to that url" do
|
||||
request = Request.instantiate(:to => @person.url, :from => @user).save
|
||||
|
||||
request_remote = Request.new(:_id => request.id)#
|
||||
|
||||
request_remote = Request.new
|
||||
request_remote.destination_url = @user.url
|
||||
request_remote.callback_url = @user.url
|
||||
request_remote.person = @person
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
require File.dirname(__FILE__) + '/../spec_helper'
|
||||
|
||||
describe Photo do
|
||||
before do
|
||||
@user = Factory.create(:user)
|
||||
end
|
||||
it 'should save a photo to GridFS' do
|
||||
photo = Photo.new
|
||||
photo = Photo.new(:person => @user)
|
||||
fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg'
|
||||
file = File.open(fixture_name)
|
||||
photo.image = file
|
||||
|
|
|
|||
|
|
@ -42,12 +42,17 @@ end
|
|||
end
|
||||
|
||||
def stub_signature_verification
|
||||
get_models.each{ |model|
|
||||
puts model
|
||||
}
|
||||
|
||||
Post.any_instance.stubs(:verify_creator_signature).returns(true)
|
||||
StatusMessage.any_instance.stubs(:verify_creator_signature).returns(true)
|
||||
Blog.any_instance.stubs(:verify_creator_signature).returns(true)
|
||||
Bookmark.any_instance.stubs(:verify_creator_signature).returns(true)
|
||||
Comment.any_instance.stubs(:verify_creator_signature).returns(true)
|
||||
Comment.any_instance.stubs(:verify_post_creator_signature).returns(true)
|
||||
Photo.any_instance.stubs(:verify_creator_signature).returns(true)
|
||||
Person.any_instance.stubs(:remove_key).returns(true)
|
||||
User.any_instance.stubs(:remove_key).returns(true)
|
||||
end
|
||||
|
|
@ -56,3 +61,11 @@ end
|
|||
Mocha::Mockery.instance.stubba.unstub_all
|
||||
|
||||
end
|
||||
|
||||
def get_models
|
||||
models = []
|
||||
Dir.glob( RAILS_ROOT + '/app/models/*' ).each do |f|
|
||||
models << File.basename( f ).gsub( /^(.+).rb/, '\1')
|
||||
end
|
||||
models
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue