zendesk_api 1.3.9 → 1.4.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -1
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +31 -21
  5. data/lib/zendesk_api/collection.rb +7 -0
  6. data/lib/zendesk_api/version.rb +1 -1
  7. data/spec/core/association_spec.rb +40 -40
  8. data/spec/core/client_spec.rb +37 -37
  9. data/spec/core/collection_spec.rb +81 -70
  10. data/spec/core/configuration_spec.rb +4 -4
  11. data/spec/core/create_resource_spec.rb +2 -2
  12. data/spec/core/data_resource_spec.rb +28 -28
  13. data/spec/core/inflection_spec.rb +1 -1
  14. data/spec/core/lru_cache_spec.rb +8 -8
  15. data/spec/core/middleware/request/encode_json_spec.rb +8 -8
  16. data/spec/core/middleware/request/etag_cache_spec.rb +5 -5
  17. data/spec/core/middleware/request/retry_spec.rb +10 -8
  18. data/spec/core/middleware/request/upload_spec.rb +25 -25
  19. data/spec/core/middleware/response/callback_spec.rb +1 -1
  20. data/spec/core/middleware/response/deflate_spec.rb +1 -1
  21. data/spec/core/middleware/response/gzip_spec.rb +1 -1
  22. data/spec/core/middleware/response/parse_iso_dates_spec.rb +9 -9
  23. data/spec/core/middleware/response/parse_json_spec.rb +4 -4
  24. data/spec/core/middleware/response/raise_error_spec.rb +2 -2
  25. data/spec/core/read_resource_spec.rb +6 -6
  26. data/spec/core/resource_spec.rb +66 -66
  27. data/spec/core/search_spec.rb +3 -3
  28. data/spec/core/spec_helper.rb +5 -4
  29. data/spec/core/trackie_spec.rb +17 -17
  30. data/spec/live/app_installation_spec.rb +2 -2
  31. data/spec/live/app_spec.rb +1 -1
  32. data/spec/live/audit_spec.rb +2 -2
  33. data/spec/live/collection_spec.rb +8 -8
  34. data/spec/live/locale_spec.rb +1 -1
  35. data/spec/live/macro_spec.rb +4 -4
  36. data/spec/live/setting_spec.rb +1 -1
  37. data/spec/live/tag_spec.rb +7 -7
  38. data/spec/live/ticket_spec.rb +10 -10
  39. data/spec/live/topic_comment_spec.rb +2 -2
  40. data/spec/live/topic_spec.rb +2 -2
  41. data/spec/live/user_spec.rb +15 -15
  42. data/spec/macros/resource_macros.rb +17 -17
  43. metadata +2 -2
@@ -26,15 +26,15 @@ module ResourceMacros
26
26
  end
27
27
 
28
28
  it "should have an id" do
29
- @object.should_not be_nil
30
- @object.send(:id).should_not be_nil
29
+ expect(@object).to_not be_nil
30
+ expect(@object.send(:id)).to_not be_nil
31
31
  end
32
32
 
33
33
  it "should be findable", :unless => metadata[:not_findable] do
34
34
  options = default_options
35
35
  options.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
36
- described_class.find(client, options).should == @object
37
- end
36
+ expect(described_class.find(client, options)).to eq(@object)
37
+ end
38
38
 
39
39
  after(:all) do
40
40
  VCR.use_cassette("#{described_class.to_s}_create_delete") do
@@ -57,7 +57,7 @@ module ResourceMacros
57
57
  end
58
58
 
59
59
  it "should be savable" do
60
- @object.save.should be_true
60
+ expect(@object.save).to be(true)
61
61
  end
62
62
 
63
63
  context "after save" do
@@ -66,14 +66,14 @@ module ResourceMacros
66
66
  end
67
67
 
68
68
  it "should keep attributes" do
69
- @object.send(attribute).should == value
69
+ expect(@object.send(attribute)).to eq(value )
70
70
  end
71
71
 
72
72
  it "should be findable", :unless => metadata[:not_findable] do
73
73
  options = default_options
74
74
  options.merge!(:id => @object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
75
- described_class.find(client, options).should == @object
76
- end
75
+ expect(described_class.find(client, options)).to eq(@object)
76
+ end
77
77
  end
78
78
 
79
79
  after(:all) do
@@ -97,8 +97,8 @@ module ResourceMacros
97
97
  end
98
98
 
99
99
  it "should be destroyable" do
100
- @object.destroy.should be_true
101
- @object.destroyed?.should be_true
100
+ expect(@object.destroy).to be(true)
101
+ expect(@object.destroyed?).to be(true)
102
102
 
103
103
  if (!options.key?(:find) || options[:find]) && !example.metadata[:not_findable]
104
104
  opts = default_options
@@ -106,9 +106,9 @@ module ResourceMacros
106
106
  obj = silence_logger{ described_class.find(client, opts) }
107
107
 
108
108
  if options[:find]
109
- obj.send(options[:find].first).should == options[:find].last
109
+ expect(obj.send(options[:find].first)).to eq(options[:find].last)
110
110
  else
111
- obj.should be_nil
111
+ expect(obj).to be_nil
112
112
  end
113
113
  end
114
114
  end
@@ -139,19 +139,19 @@ module ResourceMacros
139
139
  args.each {|a| result = result.send(a, options) }
140
140
 
141
141
  if result.is_a?(ZendeskAPI::Collection)
142
- result.fetch(true).should_not be_empty
143
- result.fetch.should include(@object) if create
142
+ expect(result.fetch(true)).to_not be_empty
143
+ expect(result.fetch).to include(@object) if create
144
144
  object = result.first
145
145
  else
146
- result.should_not be_nil
147
- result.should == @object if create
146
+ expect(result).to_not be_nil
147
+ expect(result).to eq(@object) if create
148
148
  object = result
149
149
  end
150
150
 
151
151
  if described_class.respond_to?(:find) && !example.metadata[:not_findable]
152
152
  options = default_options
153
153
  options.merge!(:id => object.id) unless described_class.ancestors.include?(ZendeskAPI::SingularResource)
154
- described_class.find(client, options).should_not be_nil
154
+ expect(described_class.find(client, options)).to_not be_nil
155
155
  end
156
156
  end
157
157
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.9
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Davidovitz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-27 00:00:00.000000000 Z
12
+ date: 2014-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bump