g5_foundation_client 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 105ce37f62316995bc13de1ca695cabc511ae612
4
- data.tar.gz: c1c8ff75ed1280e15fc1f43a970ef3bbf138d9e7
3
+ metadata.gz: b6f1d9a7bfc23fce7af5fcdaec42e1ec1834d8cd
4
+ data.tar.gz: 88d662eb3b7b1874b7a7926eb9eef8b8bd0a1547
5
5
  SHA512:
6
- metadata.gz: 97a1355895beb3f2c8b57d3a9b911a7bd24c2e08d692a36888e10ba4cd542633d3ba8bb3c684ba0e5895b846d5ebc08688546bebadb73ff02c1697d0838da31f
7
- data.tar.gz: 0be6d18fe919210a953ef9146b6c4c6d5f49ed562c6de4dbf6ea9ca82bf5a042ea9e13129265a3a4b2f47ef404fdd0dcad80d6e2fb5b4b192e7e354c47731196
6
+ metadata.gz: 0a7f4b58fb5bc463ca4b09b75f61e3773f69ee939ac41c049cf814975d03d0f7d3562690f01c4d168995cc7cb552ccae1876ffb1178093dd869ebc1365262ddc
7
+ data.tar.gz: 6dc8ed9c406db3b3b780356d121e32fdde0edc61b28a587868b19c2ba195e719f23253c5b4c8ec58487b4715e3e1e171b5fc6628ec131c2123d154638c6dfb07
data/README.md CHANGED
@@ -28,6 +28,26 @@ It's pretty limited right now. You may fetch a Location given a UID, which must
28
28
 
29
29
  If this gets much more complicated – and it will – you should probably use YARD and point to rdoc.info, or whatever documentation builder you set up.
30
30
 
31
+ ### Testing
32
+
33
+ Some helpers methods are available to use (if you're using Rspec) by adding the following to `spec_helper`:
34
+
35
+ ```ruby
36
+ require 'g5_foundation_client/rspec'
37
+ ```
38
+
39
+ If your environment includes FactoryGirl, this will also require some factory definitions. You probably want this.
40
+
41
+ This will give you a method to stub finding a `G5FoundationClient::Location`. Basic example:
42
+ ```ruby
43
+ stub_location_for_uid(
44
+ "http://example.com/location_uid",
45
+ G5FoundationClient::Location.new(name: "My Location")
46
+ )
47
+ ```
48
+
49
+ If you have FactoryGirl, you can omit the second argument and it will build one for you. The `stub_location_for_uid` method will return the built location, which can pair nicely with a `let!` call to both build and stub in one shot.
50
+
31
51
  ### Contributing
32
52
 
33
53
  Create a Github pull request. Please make sure that Travis CI passes before you do.
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :g5_location, class: G5FoundationClient::Location do
3
+ name "Test Location"
4
+ phone "123-123-1234"
5
+ end
6
+ end
@@ -0,0 +1,20 @@
1
+ module G5FoundationClient::RspecHelpers
2
+ def stub_location_for_uid(uid, location = nil)
3
+ location ||= FactoryGirl.build(:g5_location)
4
+
5
+ G5FoundationClient::Location.
6
+ stub(:find_by_uid).
7
+ with(uid).
8
+ and_return(location)
9
+
10
+ location
11
+ end
12
+ end
13
+
14
+ RSpec.configure do |config|
15
+ config.include G5FoundationClient::RspecHelpers
16
+ end
17
+
18
+ if defined?(FactoryGirl)
19
+ require 'g5_foundation_client/rspec/factories'
20
+ end
@@ -1,3 +1,3 @@
1
1
  module G5FoundationClient
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_foundation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Petersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-04 00:00:00.000000000 Z
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -156,6 +156,8 @@ files:
156
156
  - lib/g5_foundation_client/fetcher.rb
157
157
  - lib/g5_foundation_client/models/location.rb
158
158
  - lib/g5_foundation_client/record_not_found_exception.rb
159
+ - lib/g5_foundation_client/rspec.rb
160
+ - lib/g5_foundation_client/rspec/factories.rb
159
161
  - lib/g5_foundation_client/version.rb
160
162
  - spec/fixtures/location_detail.html
161
163
  - spec/lib/g5_foundation_client/deserializers/location_spec.rb
@@ -163,7 +165,6 @@ files:
163
165
  - spec/lib/g5_foundation_client/models/location_spec.rb
164
166
  - spec/lib/g5_foundation_client_spec.rb
165
167
  - spec/spec_helper.rb
166
- - wooo.creds
167
168
  homepage: https://github.com/g5/g5_foundation_client
168
169
  licenses:
169
170
  - MIT
data/wooo.creds DELETED
@@ -1,6 +0,0 @@
1
- ENV["G5_AUTH_CLIENT_ID"] = "88aa19805f81835354be522ff3ff9c44a0c90fbbc3ed4980814a006768333797"
2
- ENV["G5_AUTH_CLIENT_SECRET"] = "237c83f987a409a2027347bc1ee97c036cc3d9e038fc8db68e7e6ce525955cc5"
3
- ENV["G5_AUTH_ENDPOINT"] = "https://auth.g5search.com"
4
- ENV["G5_AUTH_PASSWORD"] = "oaregjoiaergjoierga89489234089imczopuiewrq&@#$%^@UIWECH78623784678328957832NJKHCWUIHCUEKWHEKCHK2u38o2j3aiuwdihla38y29483279482379jcdoajiejc"
5
- ENV["G5_AUTH_REDIRECT_URI"] = "https://g5-cxm-6d4u4sc-madrona.herokuapp.com/g5_auth/users/auth/g5/callback"
6
- ENV["G5_AUTH_USERNAME"] = "g5dev+serviceaccount@g5searchmarketing.com"