shopkit 0.1.1 → 0.1.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.
@@ -10,7 +10,7 @@ module Shopkit
10
10
  #@conn ||= Faraday.new(:url => "https://#{url}") do |builder|
11
11
  @conn ||= Faraday.new(:url => "http://#{url}") do |builder|
12
12
  builder.request :oauth2, access_token
13
- #builder.request :json
13
+ builder.request :json # fixed: NoMethodError: undefined method `bytesize' for {...}:Hash
14
14
 
15
15
  builder.response :logger
16
16
  builder.response :json, :content_type => /\bjson$/
@@ -1,3 +1,3 @@
1
1
  module Shopkit
2
- VERSION = "0.1.1" unless defined?(Shopkit::VERSION)
2
+ VERSION = "0.1.2" unless defined?(Shopkit::VERSION)
3
3
  end
data/shopkit.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "shopkit"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["saberma"]
12
- s.date = "2012-07-13"
12
+ s.date = "2012-07-18"
13
13
  s.description = "a gem for the ShopQi API"
14
14
  s.email = "mahb45@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -2,8 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe Shopkit::Client::Webhooks do
4
4
 
5
+ let(:request_body) { { webhook: { event:"order/fulfilled", callback_url: "http://lvh.me/webhook" }}.to_json }
6
+
5
7
  before do
6
- fake_web 'webhooks', method: :post, json_file: :webhook
8
+ fake_web 'webhooks', method: :post, request_body: request_body, json_file: :webhook
7
9
  end
8
10
 
9
11
  it 'should be create' do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'json'
1
2
  require 'shopkit'
2
3
  require 'webmock/rspec'
3
4
 
@@ -16,12 +17,13 @@ RSpec.configure do |config|
16
17
 
17
18
  def fake_web(endpoint, options={})
18
19
  file = options[:json_file] || endpoint
20
+ request_body = options.delete(:request_body)
19
21
  body = options.has_key?(:body) ? options.delete(:body) : load_json(file)
20
22
  method = options.delete(:method) || :get
21
23
 
22
24
  #url = "https://#{Shopkit.url}/api/#{endpoint}.json"
23
25
  url = "http://#{Shopkit.url}/api/#{endpoint}.json"
24
- stub_request(method, url).to_return(body: body, headers: { content_type: 'text/json' })
26
+ stub_request(method, url).with(body: request_body).to_return(body: body, headers: { content_type: 'text/json' })
25
27
  end
26
28
 
27
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-13 00:00:00.000000000 Z
12
+ date: 2012-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -191,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: 15336915
194
+ hash: -637412657
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  none: false
197
197
  requirements: