argyle 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +29 -0
- data/app/controllers/argyle/callback_controller.rb +26 -0
- data/app/helpers/argyle_helper.rb +21 -0
- data/config/initializers/argyle.rb +3 -0
- data/lib/argyle.rb +28 -0
- data/lib/argyle/configuration.rb +17 -0
- data/lib/argyle/engine.rb +12 -0
- data/lib/argyle/version.rb +3 -0
- data/lib/tasks/argyle_tasks.rake +4 -0
- data/spec/argyle/configuration_spec.rb +94 -0
- data/spec/argyle_spec.rb +25 -0
- data/spec/controllers/argyle_callback_controller_spec.rb +65 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/plaid_controller.rb +4 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/plaid/index.html.erb +4 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +32 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/argyle.rb +5 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +16 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1080 -0
- data/spec/dummy/log/test.log +7272 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/0ieeKnMtadPClPcf7n4_-7f9dFAa5EKPn-nhh8g4E_I.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/1MaC3BKD874nKekA9l4_uDMdzybsPdMFXBLq6Wikd9o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3fB7XY5WyPu8FySUeyC372vbXJ2Ix4iB1QaNHXbk_BY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4PUnpQHDua-Xqo8JWcao3dmnAGw5Qe86hCt0-euUuu4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4Ua8dmLUr8Toa4KitoJOWPCWmQDUtkViHxkOWgNr_4U.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4jJgwEH8G9g2ZAihwnJTyYF3AUsGx_Tfzt6CkLqIQ6A.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4uLvoxkzCVfJVJGG_yk7-GxdRWB0va-PV2IwuaJCs2A.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4zfBHPrVSAAH7NQNP2QCF7SQ8bIdR6Kxu9l50BcjISw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6XkmYPT23r37FfIrNvKhSeWMc3qjH6W_f0jr7C1f_do.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7isDUhDWtRexG1DWTGOm9_t-JL7uJgeu78ztyB0b03g.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/81rcybOgkCiUw5_T7OJ4LsBCoNBgg59p9-GAW-ao8yg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/C9ZIizNokjDxVBj2Zzsaxfn2NWRJR4ubGsuRhWj2Ayk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EHcymtlGKlOMMf7gOs-X2_jpvcBTW92Qeaxu2B5-Wbg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/GlO_ji60pMJWu8djobXyzbXfdHiUnYUIZGP3Iklzlzs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Gl_3O9A3P4yb3yQkXNcH5ITZXKctEiak8xVMk-A65t0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KkIrOm7xAhVkQo8Du-RfPAbPpKqdhLMDO2gN5xnmMyY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/LuPYGdHx9uNcIHa92OGqn2gmusn0X-3aVked2gVDbbY.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/M_Gi1TlHRqty6YLFeS71JIrdZEvtoVSuipxWoNVCiKw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NPnYhRY8XHqo9xm-W8rTx5XFDR4oSOtbL82PSgm-Si4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/RmbxMxzYgiU4Cv6SMw_GKIC6a4ROERW3Ptws_pL2ZAQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/SGxtd6iKmB2TMwH-VOx-jVYXh5m_09UjNEOkifPHLL0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UTWEuFLfi6c3KWTx7wWgorjc6dzYS1Kr4zRhOg1ReZk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/VRd0ChM7VK6N6MmWoyOo-a21Ja8vfymGvSyusF0ritM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/fgeo8jZxWA-gSZNySPVhnK07UoUU1b5JEGH96pV3vcw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gM11O4aG_wI3dsZZvN0ynldrZwlkRE4l03x6p5aNyaU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hBQZsCQk7Zn_j83HxEtlCI_4LFQclQ9wcpepQlf5dDM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/hmEuQnGmEBUQv7XA0QnsKIVaLBzYgLYomOgInHpAIEE.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/mGxm5paEpvvBYO6hvKVXBnjxTf4BbdcjQqoy9-hqy0M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rszxBavuJY50FFsWIWubPAdfh0aHwmLuN9ThEwjo2_I.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tDL1djgNdC4vxYBar7DFV9t6UZP4VV4wcKWuTFdHhf8.cache +1 -0
- data/spec/helpers/argyle_helper_spec.rb +65 -0
- data/spec/spec_helper.rb +28 -0
- metadata +299 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: ce90bf5e8ffa6a81c060810623886a7d44f819c7
|
|
4
|
+
data.tar.gz: d70411beeacf257f693a3977c3f4730046e2b5d9
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5f15a6eaaed637c2c38c07e14e4eebeb7ff9e57fc2e527c2159d3b5f8a8806de5f6227f5f6501105328c86c1e8d9da379a98fd8af870aa14edb88056a2eb8375
|
|
7
|
+
data.tar.gz: 31ec7032f8d7f59cc5d340c534f56714b2572679a053932e4de95d8da7eda8d92f73636915b4d5ecd38b38ebeda9afb72b0aef2ec793f13a2310df6f96dd28ac
|
data/Rakefile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
require 'rdoc/task'
|
|
8
|
+
|
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
11
|
+
rdoc.title = 'Argyle'
|
|
12
|
+
rdoc.options << '--line-numbers'
|
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
18
|
+
load 'rails/tasks/engine.rake'
|
|
19
|
+
|
|
20
|
+
load 'rails/tasks/statistics.rake'
|
|
21
|
+
|
|
22
|
+
Bundler::GemHelper.install_tasks
|
|
23
|
+
|
|
24
|
+
require 'rspec/core'
|
|
25
|
+
require 'rspec/core/rake_task'
|
|
26
|
+
desc "Run all specs in spec directory (excluding plugin specs)"
|
|
27
|
+
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
|
|
28
|
+
task :default => :spec
|
|
29
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class Argyle::CallbackController < ApplicationController
|
|
2
|
+
before_filter :plaid_exchange_token
|
|
3
|
+
|
|
4
|
+
def plaid_access_token
|
|
5
|
+
@plaid_access_token ||= plaid_exchange_token.access_token
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def plaid_user
|
|
9
|
+
@plaid_user ||= Argyle.plaid_client.set_user(plaid_access_token, plaid_products)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
protected
|
|
13
|
+
|
|
14
|
+
def plaid_public_token
|
|
15
|
+
raise Argyle::Error, "public token not present in request" unless params[:public_token]
|
|
16
|
+
params[:public_token]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def plaid_exchange_token
|
|
20
|
+
@plaid_access_token_response ||= Argyle.plaid_client.exchange_token(plaid_public_token)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def plaid_products
|
|
24
|
+
Array(Argyle.configuration.product)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module ArgyleHelper
|
|
2
|
+
def plaid_link(options)
|
|
3
|
+
raise Argyle::Error, "Public key must be set in Argyle configuration" unless Argyle.configuration.key
|
|
4
|
+
raise Argyle::Error, "options[:name] is required for Plaid Link" unless options[:name]
|
|
5
|
+
raise Argyle::Error, "options[:action] is required for Plaid Link" unless options[:action]
|
|
6
|
+
|
|
7
|
+
id = options[:form_id] || 'plaidForm'
|
|
8
|
+
product = options[:product] || Argyle.configuration.product
|
|
9
|
+
env = options[:env] || Argyle.configuration.env
|
|
10
|
+
|
|
11
|
+
plaid_link_form(id, options[:action]) + plaid_link_script(id, options[:name], product, env)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def plaid_link_form(id, action)
|
|
15
|
+
form_tag action, method: 'POST', id: id
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def plaid_link_script(id, name, product, env)
|
|
19
|
+
javascript_tag '', src: Argyle.configuration.plaid_src, data: {'client-name' => name, 'form-id' => id, 'key' => Argyle.configuration.key, 'product' => product, 'env' => env }
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/argyle.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'plaid'
|
|
2
|
+
require_relative 'argyle/version'
|
|
3
|
+
require_relative 'argyle/configuration'
|
|
4
|
+
require_relative 'argyle/engine'
|
|
5
|
+
|
|
6
|
+
module Argyle
|
|
7
|
+
class Error < StandardError; end
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
attr_writer :configuration
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.configuration
|
|
14
|
+
@configuration ||= Configuration.new
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.configure
|
|
18
|
+
yield(configuration)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.plaid_client
|
|
22
|
+
@plaid_client ||= Plaid.config do |p|
|
|
23
|
+
p.customer_id = configuration.customer_id
|
|
24
|
+
p.secret = configuration.secret
|
|
25
|
+
p.environment_location = configuration.environment_location
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Argyle
|
|
2
|
+
class Configuration
|
|
3
|
+
attr_accessor :plaid_src, :product, :key, :env, :long_tail, :customer_id, :secret
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
@plaid_src = "https://cdn.plaid.com/link/stable/link-initialize.js"
|
|
7
|
+
@product = 'auth'
|
|
8
|
+
@env = 'tartan'
|
|
9
|
+
@long_tail = false
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def environment_location
|
|
13
|
+
return "https://api.plaid.com/" if @env == 'production'
|
|
14
|
+
"https://tartan.plaid.com/"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
describe Argyle::Configuration do
|
|
5
|
+
|
|
6
|
+
describe '#plaid_src' do
|
|
7
|
+
it 'should have a default value' do
|
|
8
|
+
expect(Argyle::Configuration.new.plaid_src).to eq("https://cdn.plaid.com/link/stable/link-initialize.js")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
it 'can set value' do
|
|
13
|
+
config = Argyle::Configuration.new
|
|
14
|
+
config.plaid_src = "http://example.com"
|
|
15
|
+
|
|
16
|
+
expect(config.plaid_src).to eq("http://example.com")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe '#product=' do
|
|
21
|
+
it 'has a default value' do
|
|
22
|
+
config = Argyle::Configuration.new
|
|
23
|
+
expect(config.product).to eq("auth")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'can set value' do
|
|
27
|
+
config = Argyle::Configuration.new
|
|
28
|
+
config.product = "connect"
|
|
29
|
+
|
|
30
|
+
expect(config.product).to eq("connect")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe '#env=' do
|
|
35
|
+
it 'has a default value' do
|
|
36
|
+
config = Argyle::Configuration.new
|
|
37
|
+
expect(config.env).to eq("tartan")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'can set value' do
|
|
41
|
+
config = Argyle::Configuration.new
|
|
42
|
+
config.env = "production"
|
|
43
|
+
|
|
44
|
+
expect(config.env).to eq("production")
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
describe '#long_tail=' do
|
|
50
|
+
it 'has a default value' do
|
|
51
|
+
config = Argyle::Configuration.new
|
|
52
|
+
expect(config.long_tail).to eq(false)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
it 'can set value' do
|
|
56
|
+
config = Argyle::Configuration.new
|
|
57
|
+
config.long_tail = true
|
|
58
|
+
|
|
59
|
+
expect(config.long_tail).to eq(true)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
describe '#customer_id=' do
|
|
65
|
+
it 'can set value' do
|
|
66
|
+
config = Argyle::Configuration.new
|
|
67
|
+
config.customer_id = 'myId'
|
|
68
|
+
|
|
69
|
+
expect(config.customer_id).to eq('myId')
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
describe '#secret=' do
|
|
74
|
+
it 'can set value' do
|
|
75
|
+
config = Argyle::Configuration.new
|
|
76
|
+
config.secret = 'mysecret'
|
|
77
|
+
|
|
78
|
+
expect(config.secret).to eq('mysecret')
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
describe '#environment_location' do
|
|
83
|
+
it 'has a default value (test)' do
|
|
84
|
+
config = Argyle::Configuration.new
|
|
85
|
+
expect(config.environment_location).to eq('https://tartan.plaid.com/')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
it 'has a production value' do
|
|
89
|
+
config = Argyle::Configuration.new
|
|
90
|
+
config.env = 'production'
|
|
91
|
+
expect(config.environment_location).to eq('https://api.plaid.com/')
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
data/spec/argyle_spec.rb
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Argyle do
|
|
4
|
+
describe '#configure' do
|
|
5
|
+
it 'responds to .configure' do
|
|
6
|
+
expect(Argyle).to respond_to(:configure)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it 'makes configuration accessible' do
|
|
10
|
+
expect(Argyle.configuration).to respond_to(:plaid_src)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe '#Error' do
|
|
15
|
+
it 'specifies an error' do
|
|
16
|
+
expect { raise Argyle::Error }.to raise_exception(Argyle::Error)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe '#plaid_client' do
|
|
21
|
+
it 'responds to plaid_client' do
|
|
22
|
+
expect(Argyle).to respond_to(:plaid_client)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe Argyle::CallbackController do
|
|
4
|
+
|
|
5
|
+
describe "plaid_access_token" do
|
|
6
|
+
before do
|
|
7
|
+
controller.params[:public_token] = 'myPublicToken'
|
|
8
|
+
allow(controller).to receive(:plaid_exchange_token).and_return(Plaid::ExchangeTokenResponse.new({'access_token' => 'myToken'}))
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "calls plaid_exchange_token" do
|
|
12
|
+
expect(controller).to receive(:plaid_exchange_token)
|
|
13
|
+
controller.plaid_access_token
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "returns a plaid access token" do
|
|
17
|
+
expect(controller.send(:plaid_access_token)).to eq('myToken')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe "plaid_user" do
|
|
22
|
+
before do
|
|
23
|
+
allow(controller).to receive(:plaid_access_token).and_return('myAccessToken')
|
|
24
|
+
allow(controller).to receive(:plaid_products).and_return(["auth"])
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "calls Plaid.set_user method" do
|
|
28
|
+
expect(Argyle.plaid_client).to receive(:set_user).with('myAccessToken', ["auth"])
|
|
29
|
+
controller.plaid_user
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
describe "plaid_exchange_token" do
|
|
34
|
+
before(:each) do
|
|
35
|
+
controller.params[:public_token] = 'myPublicToken'
|
|
36
|
+
allow(Argyle.plaid_client).to receive(:exchange_token).and_return(Plaid::ExchangeTokenResponse.new)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "calls the Plaid.exchange_token method" do
|
|
40
|
+
expect(Argyle.plaid_client).to receive(:exchange_token).with('myPublicToken')
|
|
41
|
+
controller.send(:plaid_exchange_token)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "returns a plaid access_token_response" do
|
|
45
|
+
expect(controller.send(:plaid_exchange_token)).to be_a(Plaid::ExchangeTokenResponse)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
describe "plaid_products" do
|
|
50
|
+
it "returns an array" do
|
|
51
|
+
expect(controller.send(:plaid_products)).to be_a(Array)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it "returns configured products in array" do
|
|
55
|
+
expect(controller.send(:plaid_products).count).to eq(1)
|
|
56
|
+
expect(controller.send(:plaid_products).first).to eq("auth")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe "plaid_public_token" do
|
|
61
|
+
it "raises if public_token is not present" do
|
|
62
|
+
expect{controller.send(:plaid_public_token)}.to raise_exception(Argyle::Error)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
== README
|
|
2
|
+
|
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
|
4
|
+
application up and running.
|
|
5
|
+
|
|
6
|
+
Things you may want to cover:
|
|
7
|
+
|
|
8
|
+
* Ruby version
|
|
9
|
+
|
|
10
|
+
* System dependencies
|
|
11
|
+
|
|
12
|
+
* Configuration
|
|
13
|
+
|
|
14
|
+
* Database creation
|
|
15
|
+
|
|
16
|
+
* Database initialization
|
|
17
|
+
|
|
18
|
+
* How to run the test suite
|
|
19
|
+
|
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
|
21
|
+
|
|
22
|
+
* Deployment instructions
|
|
23
|
+
|
|
24
|
+
* ...
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
|
28
|
+
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
+
// listed below.
|
|
3
|
+
//
|
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
|
6
|
+
//
|
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
+
// compiled file.
|
|
9
|
+
//
|
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
|
11
|
+
// about supported directives.
|
|
12
|
+
//
|
|
13
|
+
//= require_tree .
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
+
* listed below.
|
|
4
|
+
*
|
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
+
*
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
|
11
|
+
* file per style scope.
|
|
12
|
+
*
|
|
13
|
+
*= require_tree .
|
|
14
|
+
*= require_self
|
|
15
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Dummy</title>
|
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
|
|
11
|
+
<%= yield %>
|
|
12
|
+
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|