ngp_van 0.8.0 → 0.9.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/ngp_van/client.rb +2 -0
- data/lib/ngp_van/client/stories.rb +16 -0
- data/lib/ngp_van/version.rb +1 -1
- data/spec/ngp_van/client/stories_spec.rb +66 -0
- data/spec/support/fixtures/create_story.json +17 -0
- data/spec/support/fixtures/story.json +18 -0
- metadata +32 -28
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986b916578056027f4a48d0697590e5b94a42fc1f19ce69064829eeebc307827
|
4
|
+
data.tar.gz: 2f101d57778b4d3e42178101d7a4fcf92f0ee8d3a730a8d7a994956a95987ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 192aca1faea78289b8af83fdb77948ec925c453804a6d79e1eeb0afbce74d6f919c1f21e2d4b21fa64b0eee0fbf913cbd00b40e11ffe311c6c499eb03199fffc
|
7
|
+
data.tar.gz: e39e207c65d3421268d90c71d07efd2a3484e3070814b6c443aac940a39b14610838e79907de5d072fc4a25cc9890fdb320a4f09735746c7e15ba53953c9db21
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/ngp_van/client.rb
CHANGED
@@ -17,6 +17,7 @@ require 'ngp_van/client/people'
|
|
17
17
|
require 'ngp_van/client/printed_lists'
|
18
18
|
require 'ngp_van/client/minivan_exports'
|
19
19
|
require 'ngp_van/client/signups'
|
20
|
+
require 'ngp_van/client/stories'
|
20
21
|
require 'ngp_van/client/survey_questions'
|
21
22
|
require 'ngp_van/client/supporter_groups'
|
22
23
|
require 'ngp_van/client/users'
|
@@ -60,6 +61,7 @@ module NgpVan
|
|
60
61
|
include NgpVan::Client::PrintedLists
|
61
62
|
include NgpVan::Client::MinivanExports
|
62
63
|
include NgpVan::Client::Signups
|
64
|
+
include NgpVan::Client::Stories
|
63
65
|
include NgpVan::Client::SupporterGroups
|
64
66
|
include NgpVan::Client::SurveyQuestions
|
65
67
|
include NgpVan::Client::Users
|
data/lib/ngp_van/version.rb
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module NgpVan
|
6
|
+
class Client
|
7
|
+
RSpec.describe Stories do
|
8
|
+
let(:client) { NgpVan::Client.new }
|
9
|
+
|
10
|
+
describe '#create_story' do
|
11
|
+
let(:body) do
|
12
|
+
JSON.parse(fixture('create_story.json').read)
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:url) { build_url(client: client, path: 'stories') }
|
16
|
+
|
17
|
+
before do
|
18
|
+
stub_request(:post, url)
|
19
|
+
.with(body: JSON.generate(body))
|
20
|
+
.to_return(
|
21
|
+
body: '123',
|
22
|
+
status: 201
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'requests the correct resource' do
|
27
|
+
client.create_story(body: body)
|
28
|
+
expect(
|
29
|
+
a_request(:post, url)
|
30
|
+
.with(
|
31
|
+
body: body
|
32
|
+
)
|
33
|
+
).to have_been_made
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'returns the created id' do
|
37
|
+
expect(client.create_story(body: body)).to eq(123)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'story' do
|
42
|
+
let(:response) { fixture('story.json') }
|
43
|
+
let(:url) { build_url(client: client, path: 'stories/123') }
|
44
|
+
|
45
|
+
before do
|
46
|
+
stub_request(:get, url).to_return(body: response)
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'requests the correct resource' do
|
50
|
+
client.story(id: 123)
|
51
|
+
expect(a_request(:get, url)).to have_been_made
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'returns an event object' do
|
55
|
+
story = client.story(id: 123)
|
56
|
+
expect(story).to be_a(Hash)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'returns the requested story' do
|
60
|
+
story = client.story(id: 123)
|
61
|
+
expect(story['storyId']).to eq(123)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"title": "A Tale of Two Cities",
|
3
|
+
"storyText": "It was the best of times, it was the worst of times ...",
|
4
|
+
"storyStatus": {
|
5
|
+
"storyStatusId": 1
|
6
|
+
},
|
7
|
+
"vanId": 1000000000,
|
8
|
+
"tags": [
|
9
|
+
{
|
10
|
+
"codeId": 123
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"codeId": 456
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"campaignId": 123456
|
17
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"storyId": 123,
|
3
|
+
"title": "A Tale of Two Cities",
|
4
|
+
"storyText": "It was the best of times, it was the worst of times ...",
|
5
|
+
"storyStatus": {
|
6
|
+
"storyStatusId": 1
|
7
|
+
},
|
8
|
+
"vanId": 1000000000,
|
9
|
+
"tags": [
|
10
|
+
{
|
11
|
+
"codeId": 123
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"codeId": 456
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"campaignId": 123456
|
18
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ngp_van
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Styles
|
@@ -10,33 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |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24
|
+
VVzTO9tPE3vuw0VbRIpnoOtI3d3l2963599F8bGGYrBo0EVn4xGXfTc6iVkCAwEA
|
25
|
+
AaOBijCBhzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUTrohr1Ky
|
26
|
+
ZVfO+MtSQ5tYNo8CF6wwJgYDVR0RBB8wHYEbY2hyaXN0b3BoZXJzdHlsZXNAZ21h
|
27
|
+
aWwuY29tMCYGA1UdEgQfMB2BG2NocmlzdG9waGVyc3R5bGVzQGdtYWlsLmNvbTAN
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAh4WZYz3SeRHzwB4ILMxqubH8imZ1V3R1imIPyv8G
|
29
|
+
/+rrAP7m4E3KQq7NlRTZ2t1PRK5u7WUV5Bw01VBVENPs3zNU/XpVYxaUA+MgMXdV
|
30
|
+
T8togmjQwlR+1UgEAXBTPNsTmCQa1/AQbaKA1H74G6dmI0EFPtJp9iUDBJdnpHWK
|
31
|
+
utcq8zV/8qunWPe8plxU5PQdC563u0cxLCyeH5g+sbO1lrAQwr2+utkeQ+JxJuH8
|
32
|
+
kqpcICPQ7Kb87e6MWZtLbpZ0sriVzecz7pZpiStKVeaXMlt3SxcNF4NMbLPknSXz
|
33
|
+
uZdGbGIeaVjbecRGB9oGjJzupdW5sSighBlfxTVt6pYVq8p7PGuerJXCwf/LF9ab
|
34
|
+
V/0F9DtlZbiSsr3zEzA2uCmpXaG56+1+EtdjM9uB4UHMe6sCxcy+dBiubF2MENXq
|
35
|
+
39TOGM5UYCjPNfgN1phZsQZYAqt9izy3YK2+ih92vtsB+0z4Cs9UanhYj97Z4lj+
|
36
|
+
cQFVep+b/7Dph1WPZLQM7aAX
|
38
37
|
-----END CERTIFICATE-----
|
39
|
-
date: 2019-
|
38
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
40
39
|
dependencies:
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: faraday
|
@@ -102,6 +101,7 @@ files:
|
|
102
101
|
- lib/ngp_van/client/people.rb
|
103
102
|
- lib/ngp_van/client/printed_lists.rb
|
104
103
|
- lib/ngp_van/client/signups.rb
|
104
|
+
- lib/ngp_van/client/stories.rb
|
105
105
|
- lib/ngp_van/client/supporter_groups.rb
|
106
106
|
- lib/ngp_van/client/survey_questions.rb
|
107
107
|
- lib/ngp_van/client/users.rb
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- spec/ngp_van/client/people_spec.rb
|
127
127
|
- spec/ngp_van/client/printed_lists_spec.rb
|
128
128
|
- spec/ngp_van/client/signups_spec.rb
|
129
|
+
- spec/ngp_van/client/stories_spec.rb
|
129
130
|
- spec/ngp_van/client/supporter_groups_spec.rb
|
130
131
|
- spec/ngp_van/client/survey_questions_spec.rb
|
131
132
|
- spec/ngp_van/client/users_spec.rb
|
@@ -148,6 +149,7 @@ files:
|
|
148
149
|
- spec/support/fixtures/create_event_shift.json
|
149
150
|
- spec/support/fixtures/create_location.json
|
150
151
|
- spec/support/fixtures/create_signup.json
|
152
|
+
- spec/support/fixtures/create_story.json
|
151
153
|
- spec/support/fixtures/create_supporter_group.json
|
152
154
|
- spec/support/fixtures/create_user_district_field_values.json
|
153
155
|
- spec/support/fixtures/district_field.json
|
@@ -177,6 +179,7 @@ files:
|
|
177
179
|
- spec/support/fixtures/signup.json
|
178
180
|
- spec/support/fixtures/signup_statuses.json
|
179
181
|
- spec/support/fixtures/signups.json
|
182
|
+
- spec/support/fixtures/story.json
|
180
183
|
- spec/support/fixtures/supporter_group.json
|
181
184
|
- spec/support/fixtures/supporter_groups.json
|
182
185
|
- spec/support/fixtures/survey_question.json
|
@@ -209,7 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
212
|
- !ruby/object:Gem::Version
|
210
213
|
version: '0'
|
211
214
|
requirements: []
|
212
|
-
|
215
|
+
rubyforge_project:
|
216
|
+
rubygems_version: 2.7.6
|
213
217
|
signing_key:
|
214
218
|
specification_version: 4
|
215
219
|
summary: Ruby wrapper for the NGP VAN API
|
metadata.gz.sig
CHANGED
Binary file
|