fortnox 0.0.1 → 0.0.3

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.
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
7
7
  s.version = Fortnox::VERSION
8
8
  s.authors = ["Jonas Arnklint", "Kevin Sjöberg"]
9
9
  s.email = ["jonas@fkw.se", "kev.sjoberg@gmail.com"]
10
- s.homepage = ""
11
- s.summary = %q{Handle invoices and customers through the Fortnox API}
10
+ s.homepage = "http://pushforward.se"
11
+ s.summary = %q{Small Ruby wrapper around Fortnox API}
12
12
  s.description = %q{Handle invoices and customers through the Fortnox API}
13
13
 
14
14
  s.rubyforge_project = "fortnox"
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency "rspec"
22
22
  s.add_development_dependency "vcr"
23
23
  s.add_development_dependency "webmock"
24
-
24
+
25
25
  s.add_runtime_dependency "httparty"
26
26
  s.add_runtime_dependency "gyoku"
27
27
  end
@@ -11,9 +11,9 @@ module Fortnox
11
11
  raise Error, response.body
12
12
  end
13
13
  end
14
-
14
+
15
15
  def update(attributes={})
16
- response = run :post, :set_invoice, with_root(attributes)
16
+ response = run :post, :set_invoice, with_root(attributes)
17
17
  response['result'] ? response['result']['id'].to_i : false
18
18
  end
19
19
 
@@ -21,12 +21,17 @@ module Fortnox
21
21
  response = run :post, :set_invoice_cancel, { :query => { :id => id } }
22
22
  response['result'] ? response['result'].to_i : false
23
23
  end
24
-
24
+
25
+ def show(id)
26
+ response = run :get, :get_invoice, { :query => { :id => id } }
27
+ response['invoice'] ? response['invoice']['status'] : false
28
+ end
29
+
25
30
  private
26
-
31
+
27
32
  def with_root(attributes)
28
33
  { :invoice => attributes }
29
- end
34
+ end
30
35
  end
31
36
  end
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module Fortnox
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -34,5 +34,12 @@ module Fortnox
34
34
  invoice_no.should eq(1)
35
35
  end
36
36
  end
37
+
38
+ it "should fetch invoice with id" do
39
+ VCR.use_cassette('invoice/show') do
40
+ invoice_no = Invoice.show(1)
41
+ invoice_no.status.should be_a(String)
42
+ end
43
+ end
37
44
  end
38
45
  end
@@ -23,4 +23,5 @@ VCR.config do |c|
23
23
  c.default_cassette_options = {:match_requests_on => [:method, :uri, :body]}
24
24
  c.cassette_library_dir = 'spec/fixtures/cassettes'
25
25
  c.stub_with :webmock
26
+ c.ignore_localhost = true
26
27
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortnox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonas Arnklint
@@ -16,8 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-03-20 00:00:00 +01:00
20
- default_executable:
19
+ date: 2012-11-15 00:00:00 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: rspec
@@ -119,8 +118,7 @@ files:
119
118
  - spec/unit/api_spec.rb
120
119
  - spec/unit/customer_spec.rb
121
120
  - spec/unit/invoice_spec.rb
122
- has_rdoc: true
123
- homepage: ""
121
+ homepage: http://pushforward.se
124
122
  licenses: []
125
123
 
126
124
  post_install_message:
@@ -149,10 +147,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
147
  requirements: []
150
148
 
151
149
  rubyforge_project: fortnox
152
- rubygems_version: 1.6.2
150
+ rubygems_version: 1.8.24
153
151
  signing_key:
154
152
  specification_version: 3
155
- summary: Handle invoices and customers through the Fortnox API
153
+ summary: Small Ruby wrapper around Fortnox API
156
154
  test_files:
157
155
  - spec/fixtures/invoice.yml
158
156
  - spec/integration/customer_spec.rb