Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #388 from SumOfUs/donations-akid
Browse files Browse the repository at this point in the history
Pass akid through to donations
  • Loading branch information
Tuuleh committed Feb 24, 2016
2 parents a22e5f1 + b6e1e9f commit 90e2112
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/services/action_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def user_data
last_name: member.last_name,
email: member.email,
country: member.country,
akid: data[:akid],
postal: data[:postal],
address1: data[:address1],
source: data[:source]
Expand Down
5 changes: 5 additions & 0 deletions spec/requests/api/braintree_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
email: "[email protected]",
postal: "11225",
address1: '25 Elm Drive',
akid: '1234.5678.9910',
source: 'fb',
country: "US"
}
Expand Down Expand Up @@ -124,6 +125,7 @@
country: "US",
postal: "11225",
address1: '25 Elm Drive',
akid: '1234.5678.9910',
source: 'fb',
first_name: 'Bernie',
last_name: 'Sanders'
Expand Down Expand Up @@ -334,6 +336,7 @@
email: "[email protected]",
country: "US",
postal: "11225",
akid: '1234.5678.9910',
source: 'fb',
address1: '25 Elm Drive',
first_name: 'Bernie',
Expand Down Expand Up @@ -640,6 +643,7 @@
country: "US",
postal: "11225",
address1: '25 Elm Drive',
akid: '1234.5678.9910',
source: 'fb',
first_name: 'Bernie',
last_name: 'Sanders'
Expand Down Expand Up @@ -888,6 +892,7 @@
address1: '25 Elm Drive',
first_name: 'Bernie',
last_name: 'Sanders',
akid: '1234.5678.9910',
source: 'fb'
},
action: {
Expand Down
3 changes: 3 additions & 0 deletions spec/requests/api/braintree_webhook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
email: "[email protected]",
postal: "11225",
address1: '25 Elm Drive',
akid: '1234.5678.9910',
source: 'fb',
country: "US"
}
Expand Down Expand Up @@ -108,6 +109,7 @@
postal: "11225",
address1: '25 Elm Drive',
source: 'fb',
akid: '1234.5678.9910',
first_name: 'Bernie',
last_name: 'Sanders'
},
Expand Down Expand Up @@ -160,6 +162,7 @@
postal: "11225",
address1: '25 Elm Drive',
source: 'fb',
akid: '1234.5678.9910',
first_name: 'Bernie',
last_name: 'Sanders'
},
Expand Down
9 changes: 7 additions & 2 deletions spec/services/action_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
let(:page) { create :page }
let(:member) { create :member }
let(:found_action) { Action.where(member: member, page: page).first }
let(:test_params) { {test: 'yes', foo: 'bar'}}

# Create a class which includes the ActionBuilder.
class MockActionBuilder
Expand Down Expand Up @@ -111,7 +110,7 @@ def initialize(params)

describe 'filters irrelevant' do

let(:porky_params) { params.merge(page_id: page.id, form_id: '3', blerg: false) }
let(:porky_params) { params.merge(page_id: page.id, form_id: '3', blerg: false, akid: '1234.514.lQVxcW') }

it 'keys as symbols' do
mab = MockActionBuilder.new(porky_params)
Expand All @@ -132,6 +131,12 @@ def initialize(params)
mab = MockActionBuilder.new(ActionController::Parameters.new(porky_params))
expect(mab.filtered_params).to eq params
end

it 'but passes them through to form_data' do
mab = MockActionBuilder.new(porky_params)
expect{ mab.build_action }.to change{ Action.count }.by 1
expect(Action.last.form_data).to match a_hash_including(params.stringify_keys)
end
end
end
end
Expand Down

0 comments on commit 90e2112

Please sign in to comment.