fakturan_nu 1.1.5 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6dafebdb78acba0e505fbe6832ca7ba96da38b30
4
- data.tar.gz: 1ff884a250089a2fe0b7c59d96d9aac9819fcf71
3
+ metadata.gz: 64fc9b74cfb95861e8b574f428566b6bfbd595c7
4
+ data.tar.gz: 06bf8ba9173850d5ea72d6b83480a547a978c5b6
5
5
  SHA512:
6
- metadata.gz: c69f27084c5484188782861526bd1c3959900de013e57a18366fa6b132226a7dec4ad3640b37127b608aab19bf5efe4af1e754cf16214cdf4ecb6f420f3306f4
7
- data.tar.gz: 3511e035cc2b28edb65ccccec8e45d952503ae07afaebff9b3591407c6e104f73f8795cfe2cfb5370025d7bb2b30fa4ff5c16f42e84229e766825c3e4bff0ec1
6
+ metadata.gz: f39f502582ebd9e7dd6afc6c1a860224fe7b0654bdf141bc9eb6efd6c09f859eb476e20420c53b9f27e026e3fa4104b553b958c29c239e0520e888fda35ab936
7
+ data.tar.gz: d15e1c04982734057338d0060de635f4281769d6ab160814678d85ddb36978389066af543b7d9f977a1cb6c4504ccd6c97625475e15f923ab36d2d7687a26f24
data/fakturan_nu.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'fakturan_nu'
4
- s.version = '1.1.5'
5
- s.date = '2015-05-08'
4
+ s.version = '1.2.0'
5
+ s.date = '2015-05-11'
6
6
  s.summary = 'A ruby client for the Fakturan.nu - API'
7
7
  s.description = 'A ruby client for the Fakturan.nu - API. Fakturan.nu is a webbapp for billing.'
8
8
  s.authors = ['Jonathan Bourque Olivegren']
@@ -15,5 +15,9 @@ module Fakturan
15
15
  super
16
16
  end
17
17
  end
18
+
19
+ def self.find_by(conditions = {})
20
+ where(conditions).first
21
+ end
18
22
  end
19
23
  end
data/test/models_test.rb CHANGED
@@ -21,6 +21,13 @@ module Fakturan
21
21
  @good_invoice_params ||= { client: { company: 'Imagine it AB' }, date: "2015-04-07".to_date, address: { name: "Imagine it AB", street_address: "Tage Erlandergatan 4" } }
22
22
  end
23
23
 
24
+ def test_find_by
25
+ client = Client.find_by(number: 1)
26
+ assert_equal "A simple client", client.name
27
+ client = Client.find_by(number: 1000)
28
+ assert_equal nil, client
29
+ end
30
+
24
31
  def get_good_invoice
25
32
  return if @invoice # We won't change this instance so we really only need to do this once.
26
33
  @invoice = Fakturan::Invoice.find(5)
@@ -662,4 +662,106 @@ http_interactions:
662
662
  string: '{"data":{"id":11,"number":1,"name":"A simple client","first_name":"","last_name":"","email":"someones@email.com","fax":"","phone":"","home_phone":"","mobile_phone":"","client_type":"company","org_number":"1235412574","settings":{"invoice_delivery_method":"email","locale":"sv","invoice_days":30,"invoice_template":"original","tax":25,"prices_inc_tax":"no","show_product_code":false,"currency":"SEK"},"address":{"street_address":"","care_of":"","zip_code":"","city":"","country":"SE"}}}'
663
663
  http_version:
664
664
  recorded_at: Thu, 30 Apr 2015 08:19:22 GMT
665
+ - request:
666
+ method: get
667
+ uri: https://jWE56VnOHqu-6HgaZyL2:LpdLorG0fmPRGOpeOvHSLiuloEHK0O8YsKliVPNY@sandbox.fakturan.nu/api/v2/clients?number=1
668
+ body:
669
+ encoding: US-ASCII
670
+ string: ''
671
+ headers:
672
+ User-Agent:
673
+ - Faraday v0.9.1
674
+ Accept-Encoding:
675
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
676
+ Accept:
677
+ - "*/*"
678
+ response:
679
+ status:
680
+ code: 200
681
+ message: OK
682
+ headers:
683
+ Date:
684
+ - Mon, 11 May 2015 06:48:28 GMT
685
+ Server:
686
+ - Apache/2.2.14 (Ubuntu)
687
+ Strict-Transport-Security:
688
+ - max-age=31536000
689
+ X-Frame-Options:
690
+ - SAMEORIGIN
691
+ X-Xss-Protection:
692
+ - 1; mode=block
693
+ X-Content-Type-Options:
694
+ - nosniff
695
+ Etag:
696
+ - '"ff4f7dc8d1d1390c712eca26700b8061"'
697
+ Cache-Control:
698
+ - max-age=0, private, must-revalidate
699
+ X-Request-Id:
700
+ - 1b4e633e-cd8a-42d1-8add-2efbe7a123e8
701
+ X-Runtime:
702
+ - '0.388909'
703
+ X-Powered-By:
704
+ - Phusion Passenger 4.0.50
705
+ Status:
706
+ - 200 OK
707
+ Transfer-Encoding:
708
+ - chunked
709
+ Content-Type:
710
+ - application/json; charset=utf-8
711
+ body:
712
+ encoding: UTF-8
713
+ string: '{"data":[{"id":11,"number":1,"name":"A simple client","first_name":"","last_name":"","email":"someones@email.com","fax":"","phone":"","home_phone":"","mobile_phone":"","client_type":"company","org_number":"1235412574","settings":{"invoice_delivery_method":"email","locale":"sv","invoice_days":30,"invoice_template":"original","tax":25,"discount":0,"prices_inc_tax":"no","show_product_code":false,"currency":"SEK"},"address":{"street_address":"","care_of":"","zip_code":"","city":"","country":"SE"}}],"paging":{"total_pages":1,"current_page":1,"next":null,"previous":null}}'
714
+ http_version:
715
+ recorded_at: Mon, 11 May 2015 06:48:42 GMT
716
+ - request:
717
+ method: get
718
+ uri: https://jWE56VnOHqu-6HgaZyL2:LpdLorG0fmPRGOpeOvHSLiuloEHK0O8YsKliVPNY@sandbox.fakturan.nu/api/v2/clients?number=1000
719
+ body:
720
+ encoding: US-ASCII
721
+ string: ''
722
+ headers:
723
+ User-Agent:
724
+ - Faraday v0.9.1
725
+ Accept-Encoding:
726
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
727
+ Accept:
728
+ - "*/*"
729
+ response:
730
+ status:
731
+ code: 200
732
+ message: OK
733
+ headers:
734
+ Date:
735
+ - Mon, 11 May 2015 07:18:19 GMT
736
+ Server:
737
+ - Apache/2.2.14 (Ubuntu)
738
+ Strict-Transport-Security:
739
+ - max-age=31536000
740
+ X-Frame-Options:
741
+ - SAMEORIGIN
742
+ X-Xss-Protection:
743
+ - 1; mode=block
744
+ X-Content-Type-Options:
745
+ - nosniff
746
+ Etag:
747
+ - '"ef2afa00b02669c920698b358d25d14e"'
748
+ Cache-Control:
749
+ - max-age=0, private, must-revalidate
750
+ X-Request-Id:
751
+ - 31b50fe6-cbf8-4141-9d99-b0e58f2b8edf
752
+ X-Runtime:
753
+ - '0.014433'
754
+ X-Powered-By:
755
+ - Phusion Passenger 4.0.50
756
+ Status:
757
+ - 200 OK
758
+ Transfer-Encoding:
759
+ - chunked
760
+ Content-Type:
761
+ - application/json; charset=utf-8
762
+ body:
763
+ encoding: UTF-8
764
+ string: '{"data":[],"paging":{"total_pages":1,"current_page":1,"next":null,"previous":null}}'
765
+ http_version:
766
+ recorded_at: Mon, 11 May 2015 07:18:19 GMT
665
767
  recorded_with: VCR 2.9.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakturan_nu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Bourque Olivegren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-08 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spyke