gds-api-adapters 7.7.0 → 7.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ require_relative 'base'
2
+
3
+ class GdsApi::NeedApi < GdsApi::Base
4
+
5
+ def create_need(need)
6
+ post_json!("#{endpoint}/needs", need)
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '7.7.0'
2
+ VERSION = '7.8.0'
3
3
  end
@@ -0,0 +1,20 @@
1
+ require 'test_helper'
2
+ require 'gds_api/need_api'
3
+
4
+ describe GdsApi::NeedApi do
5
+
6
+ before do
7
+ @base_api_url = Plek.current.find("needapi")
8
+ @api = GdsApi::NeedApi.new(@base_api_url)
9
+ end
10
+
11
+ describe "creating needs" do
12
+ it "should post to the right endpoint" do
13
+ request_stub = stub_request(:post, @base_api_url + "/needs").with(
14
+ :body => '{"goal":"I wanna sammich!"}'
15
+ )
16
+ @api.create_need({"goal" => "I wanna sammich!"})
17
+ assert_requested(request_stub)
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.7.0
4
+ version: 7.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -261,6 +261,7 @@ files:
261
261
  - lib/gds_api/support.rb
262
262
  - lib/gds_api/rummager.rb
263
263
  - lib/gds_api/part_methods.rb
264
+ - lib/gds_api/need_api.rb
264
265
  - lib/gds_api/exceptions.rb
265
266
  - lib/gds_api/json_client.rb
266
267
  - lib/gds_api/base.rb
@@ -300,6 +301,7 @@ files:
300
301
  - Rakefile
301
302
  - test/support_api_test.rb
302
303
  - test/mapit_test.rb
304
+ - test/need_api_test.rb
303
305
  - test/publisher_api_test.rb
304
306
  - test/fact_cave_test.rb
305
307
  - test/licence_application_api_test.rb
@@ -332,7 +334,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
332
334
  version: '0'
333
335
  segments:
334
336
  - 0
335
- hash: -310968660017522617
337
+ hash: 990016573941287017
336
338
  required_rubygems_version: !ruby/object:Gem::Requirement
337
339
  none: false
338
340
  requirements:
@@ -341,7 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
343
  version: '0'
342
344
  segments:
343
345
  - 0
344
- hash: -310968660017522617
346
+ hash: 990016573941287017
345
347
  requirements: []
346
348
  rubyforge_project:
347
349
  rubygems_version: 1.8.23
@@ -351,6 +353,7 @@ summary: Adapters to work with GDS APIs
351
353
  test_files:
352
354
  - test/support_api_test.rb
353
355
  - test/mapit_test.rb
356
+ - test/need_api_test.rb
354
357
  - test/publisher_api_test.rb
355
358
  - test/fact_cave_test.rb
356
359
  - test/licence_application_api_test.rb