Permalink
Browse files

found and fixed (hopefully) all usages of single-letter referral params

  • Loading branch information...
jimarnold committed Sep 5, 2012
1 parent 8646deb commit be9a91c8649272b773982bacf31ee44a4f3446a4
@@ -6,7 +6,7 @@ def create
facebook_autofill_request = FacebookAutofillRequest.find_by_action_id(request_id)
if facebook_request.present?
petition, member = facebook_request.petition, facebook_request.member
- redirect_to petition_path(petition, d: member.to_hash)
+ redirect_to petition_path(petition, ref_type: Signature::ReferenceType::FACEBOOK_REQUEST, ref_val: member.to_hash)
elsif facebook_autofill_request.present?
petition, member = facebook_autofill_request.petition, facebook_autofill_request.member
redirect_to petition_path(petition, autofill: member.to_hash)
@@ -36,7 +36,8 @@ def create
else
flash[:invalid_signature] = signature
end
- redirect_to petition_url(petition, l: member_hash)
+ args = member_hash ? {ref_type: Signature::ReferenceType::SHARED_LINK, ref_val: member_hash} : {}
+ redirect_to petition_url(petition, args)
end
@@ -42,7 +42,7 @@ def facebook_button
end
def fb_like(url, ref_hash, classes = nil, is_button_count = false)
- url = ref_hash ? "#{url}?f=#{ref_hash}" : url
+ url = ref_hash ? "#{url}?ref_type=#{Signature::ReferenceType::FACEBOOK_LIKE}&ref_val=#{ref_hash}" : url
attributes = {href: url, send: false, show_faces: false, action: 'like', width: '270'}
attributes.merge!({layout: 'button_count', width: '100'}) if is_button_count
tag "fb:like", {data: attributes, class: classes}, false, true
@@ -22,7 +22,7 @@
facebook_request = create(:facebook_request, petition: petition, member: member, action_id: '1234')
post(:create, {request_ids: '1234'})
- should redirect_to petition_url(petition, d: member.to_hash)
+ should redirect_to petition_url(petition, ref_type:Signature::ReferenceType::FACEBOOK_REQUEST, ref_val: member.to_hash)
end
it "should populate a facebook autofill request with petition and member" do
petition = create(:petition)
@@ -44,7 +44,7 @@
it 'should redirect to the petition page' do
hash = Signature.last.member.to_hash
- should redirect_to petition_url(petition, l: hash)
+ should redirect_to petition_url(petition, ref_type: Signature::ReferenceType::SHARED_LINK, ref_val: hash)
end
it 'should create a member record' do

0 comments on commit be9a91c

Please sign in to comment.