hoptoad-api 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -30,7 +30,7 @@ Finding Errors
30
30
  Errors are paginated, the API responds with 25 at a time, pass an optional params hash for additional pages:
31
31
 
32
32
  Hoptoad::Error.find(:all)
33
- Hoptoad::Error.find(:all, :params => { :page => 2 })
33
+ Hoptoad::Error.find(:all, :page => 2)
34
34
 
35
35
  To find an individual error, you can find by ID:
36
36
 
@@ -44,6 +44,10 @@ Find an individual notice:
44
44
 
45
45
  Hoptoad::Notice.find(notice_id, error_id)
46
46
 
47
+ To resolve an error via the API:
48
+
49
+ Hoptoad::Error.update(1696170, :group => { :resolved => true})
50
+
47
51
  Projects
48
52
  --------
49
53
 
@@ -22,7 +22,14 @@ module Hoptoad
22
22
  def self.update(error, options)
23
23
  setup
24
24
 
25
- self.class.put(collection_path, options)
25
+ response = put(error_path(error), { :query => options })
26
+ if response.code == 403
27
+ raise HoptoadError.new('SSL should be enabled - use Hoptoad.secure = true in configuration')
28
+ end
29
+ results = Hashie::Mash.new(response)
30
+
31
+ raise HoptoadError.new(results.errors.error) if results.errors
32
+ results.group
26
33
  end
27
34
 
28
35
  private
@@ -1,3 +1,3 @@
1
1
  module Hoptoad
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.0'
3
3
  end
@@ -0,0 +1,207 @@
1
+ HTTP/1.1 200 OK
2
+
3
+ <?xml version="1.0" encoding="UTF-8"?>
4
+ <group>
5
+ <action>index</action>
6
+ <controller>shades</controller>
7
+ <created-at type="datetime">2010-04-16T21:45:30Z</created-at>
8
+ <error-class>ActiveRecord::StatementInvalid</error-class>
9
+ <error-message>ActiveRecord::StatementInvalid: Mysql::Error: Unknown column 'otype' in 'order clause': SELECT shades.* FROM shades ORDER BY 'otype desc'</error-message>
10
+ <file>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb</file>
11
+ <id type="integer">1696170</id>
12
+ <lighthouse-ticket-id type="integer" nil="true"></lighthouse-ticket-id>
13
+ <line-number type="integer">219</line-number>
14
+ <most-recent-notice-at type="datetime">2010-04-24T02:27:11Z</most-recent-notice-at>
15
+ <notice-hash>71ce436b9c091d468daf479eeee4b216</notice-hash>
16
+ <notices-count type="integer">455</notices-count>
17
+ <project-id type="integer">248</project-id>
18
+ <rails-env>production</rails-env>
19
+ <resolved type="boolean">true</resolved>
20
+ <updated-at type="datetime">2010-04-24T02:27:11Z</updated-at>
21
+ <environment>
22
+ <rack-session-record>#&lt;ActiveRecord::SessionStore::Session:0x2b6486cfc9a0&gt;</rack-session-record>
23
+ <action-controller-rescue-request>#&lt;ActionController::Request:0x2b6486d02788&gt;</action-controller-rescue-request>
24
+ <server-name>_</server-name>
25
+ <http-user-agent>Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)</http-user-agent>
26
+ <rack-run-once>false</rack-run-once>
27
+ <content-length>0</content-length>
28
+ <http-via>1.0 v1-akamaitech.net(ghost) (AkamaiGHost), 1.1 akamai.net(ghost) (AkamaiGHost)</http-via>
29
+ <http-accept-encoding>gzip</http-accept-encoding>
30
+ <path-info>/company/sigm/shades</path-info>
31
+ <rack-url-scheme>http</rack-url-scheme>
32
+ <passenger-app-spawner-idle-time>0</passenger-app-spawner-idle-time>
33
+ <http-te>chunked;q=1.0</http-te>
34
+ <rack-input>#&lt;Rack::RewindableInput:0x2b6486d037a0&gt;</rack-input>
35
+ <http-host>www.myapp.com</http-host>
36
+ <http-accept-language>en-us,en;q=0.5</http-accept-language>
37
+ <server-addr>127.0.0.1</server-addr>
38
+ <http-cache-control>no-cache, max-age=0</http-cache-control>
39
+ <server-protocol>HTTP/1.0</server-protocol>
40
+ <rack-errors>#&lt;IO:0x2b647c6aeeb8&gt;</rack-errors>
41
+ <script-name></script-name>
42
+ <action-controller-request-request-parameters></action-controller-request-request-parameters>
43
+ <remote-addr>127.0.0.1</remote-addr>
44
+ <server-software>nginx/0.6.35</server-software>
45
+ <passenger-spawn-method>smart-lv2</passenger-spawn-method>
46
+ <passenger-environment>production</passenger-environment>
47
+ <http-akamai-origin-hop>2</http-akamai-origin-hop>
48
+ <rack-multithread>false</rack-multithread>
49
+ <http-accept-charset>ISO-8859-1,utf-8;q=0.7,*;q=0.7</http-accept-charset>
50
+ <http-true-client-ip>67.195.110.176</http-true-client-ip>
51
+ <rack.request.query_hash>
52
+ <options>true</options>
53
+ <sort-order>asc</sort-order>
54
+ <sort-key>strike_price_in_cents</sort-key>
55
+ </rack.request.query_hash>
56
+ <rack-version>10</rack-version>
57
+ <action_controller.request.path_parameters>
58
+ <action>index</action>
59
+ <controller>shades</controller>
60
+ <company-id>sigm</company-id>
61
+ </action_controller.request.path_parameters>
62
+ <rack-multiprocess>true</rack-multiprocess>
63
+ <http-x-akamai-config-log-detail>true</http-x-akamai-config-log-detail>
64
+ <request-uri>/company/sigm/shades?options=true&amp;sort_key=strike_price_in_cents&amp;sort_order=asc</request-uri>
65
+ <document-root>/data/myapp/current/public</document-root>
66
+ <server-port>81</server-port>
67
+ <scgi>1</scgi>
68
+ <passenger-app-type>rails</passenger-app-type>
69
+ <passenger-use-global-queue>true</passenger-use-global-queue>
70
+ <action-controller-rescue-response>#&lt;ActionController::Response:0x2b6486d02468&gt;</action-controller-rescue-response>
71
+ <remote-port>33166</remote-port>
72
+ <http-pragma>no-cache</http-pragma>
73
+ <rack-request-query-string>options=true&amp;sort_key=strike_price_in_cents&amp;sort_order=asc</rack-request-query-string>
74
+ <rack.session.options>
75
+ <domain></domain>
76
+ <id>4060bb6302450f0f0e94acc4ec9964e3</id>
77
+ <secure>false</secure>
78
+ <expire-after></expire-after>
79
+ <cookie-only>true</cookie-only>
80
+ <key>_tk_www_session</key>
81
+ <path>/</path>
82
+ <secret>270022c1d7400e0aba2f515d59d3bd56f18d036428c0a16a1292b6d4d1f0a90c67e5247f8e15d67abcc690fe94bac1793789cdef843a679231d7e43d104ad674</secret>
83
+ <httponly>true</httponly>
84
+ </rack.session.options>
85
+ <query-string>options=true&amp;sort_key=strike_price_in_cents&amp;sort_order=asc</query-string>
86
+ <rack.session>
87
+ <sliding-session-expires-at>Fri Apr 23 21:27:12 -0700 2010</sliding-session-expires-at>
88
+ </rack.session>
89
+ <http-x-forwarded-for>67.195.110.176, 96.17.69.188, 67.131.237.20</http-x-forwarded-for>
90
+ <http-accept>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</http-accept>
91
+ <action_controller.request.query_parameters>
92
+ <options>true</options>
93
+ <sort-order>asc</sort-order>
94
+ <sort-key>strike_price_in_cents</sort-key>
95
+ </action_controller.request.query_parameters>
96
+ <passenger-framework-spawner-idle-time>0</passenger-framework-spawner-idle-time>
97
+ <http-connection>close</http-connection>
98
+ <http-x-real-ip>67.131.237.20</http-x-real-ip>
99
+ <request-method>GET</request-method>
100
+ </environment>
101
+ <session>
102
+ <data>
103
+ <sliding-session-expires-at>Fri Apr 23 21:27:12 -0700 2010</sliding-session-expires-at>
104
+ </data>
105
+ </session>
106
+ <request>
107
+ <rails-root>/data/myapp/releases/20100416200739</rails-root>
108
+ <url>http://www.myapp.com/company/sigm/shades?options=true&amp;sort_key=strike_price_in_cents&amp;sort_order=asc</url>
109
+ <params>
110
+ <options>true</options>
111
+ <sort-order>asc</sort-order>
112
+ <action>index</action>
113
+ <controller>shades</controller>
114
+ <company-id>sigm</company-id>
115
+ <sort-key>strike_price_in_cents</sort-key>
116
+ </params>
117
+ </request>
118
+ <backtrace>
119
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `log_without_newrelic_instrumentation'</line>
120
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb:52:in `log'</line>
121
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:62:in `trace_method_execution_with_scope'</line>
122
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/active_record_instrumentation.rb:50:in `log'</line>
123
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:323:in `execute'</line>
124
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:608:in `select'</line>
125
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'</line>
126
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'</line>
127
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql'</line>
128
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'</line>
129
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/base.rb:661:in `find_by_sql_without_trace_ActiveRecord___self_name__find_by_sql'</line>
130
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:161:in `find_by_sql'</line>
131
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:62:in `trace_method_execution_with_scope'</line>
132
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:160:in `find_by_sql'</line>
133
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/base.rb:1548:in `find_every'</line>
134
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/base.rb:615:in `find'</line>
135
+ <line>/data/myapp/releases/20100416200739/vendor/gems/will_paginate-2.2.2/lib/will_paginate/finder.rb:82:in `send'</line>
136
+ <line>/data/myapp/releases/20100416200739/vendor/gems/will_paginate-2.2.2/lib/will_paginate/finder.rb:82:in `paginate'</line>
137
+ <line>/data/myapp/releases/20100416200739/vendor/gems/will_paginate-2.2.2/lib/will_paginate/collection.rb:87:in `create'</line>
138
+ <line>/data/myapp/releases/20100416200739/vendor/gems/will_paginate-2.2.2/lib/will_paginate/finder.rb:76:in `paginate'</line>
139
+ <line>/data/myapp/releases/20100416200739/app/controllers/shades_controller.rb:85:in `pagination_for_index'</line>
140
+ <line>/data/myapp/releases/20100416200739/app/controllers/shades_controller.rb:10:in `index'</line>
141
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `send'</line>
142
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `perform_action_without_filters'</line>
143
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'</line>
144
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'</line>
145
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'</line>
146
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'</line>
147
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:10:in `realtime'</line>
148
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'</line>
149
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'</line>
150
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'</line>
151
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/flash.rb:146:in `perform_action_without_newrelic_trace'</line>
152
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:138:in `perform_action'</line>
153
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:62:in `trace_method_execution_with_scope'</line>
154
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:122:in `perform_action'</line>
155
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/method_tracer.rb:38:in `trace_method_execution_no_scope'</line>
156
+ <line>/data/myapp/releases/20100416200739/vendor/plugins/newrelic_rpm/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:117:in `perform_action'</line>
157
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `send'</line>
158
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process_without_filters'</line>
159
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process'</line>
160
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'</line>
161
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'</line>
162
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:437:in `call'</line>
163
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'</line>
164
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'</line>
165
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'</line>
166
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'</line>
167
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'</line>
168
+ <line>/data/myapp/releases/20100416200739/vendor/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'</line>
169
+ <line>/data/myapp/releases/20100416200739/vendor/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'</line>
170
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'</line>
171
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'</line>
172
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call'</line>
173
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'</line>
174
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'</line>
175
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'</line>
176
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'</line>
177
+ <line>/data/myapp/releases/20100416200739/vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb:24:in `call'</line>
178
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'</line>
179
+ <line>/data/myapp/releases/20100416200739/vendor/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'</line>
180
+ <line>/data/myapp/releases/20100416200739/vendor/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'</line>
181
+ <line>/data/myapp/releases/20100416200739/vendor/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'</line>
182
+ <line>/data/myapp/releases/20100416200739/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'</line>
183
+ <line>/usr/lib/passenger/lib/phusion_passenger/rack/request_handler.rb:95:in `process_request'</line>
184
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'</line>
185
+ <line>/usr/lib/passenger/lib/phusion_passenger/railz/application_spawner.rb:378:in `start_request_handler'</line>
186
+ <line>/usr/lib/passenger/lib/phusion_passenger/railz/application_spawner.rb:336:in `handle_spawn_application'</line>
187
+ <line>/usr/lib/passenger/lib/phusion_passenger/utils.rb:183:in `safe_fork'</line>
188
+ <line>/usr/lib/passenger/lib/phusion_passenger/railz/application_spawner.rb:334:in `handle_spawn_application'</line>
189
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__'</line>
190
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'</line>
191
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'</line>
192
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:163:in `start'</line>
193
+ <line>/usr/lib/passenger/lib/phusion_passenger/railz/application_spawner.rb:213:in `start'</line>
194
+ <line>/usr/lib/passenger/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'</line>
195
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'</line>
196
+ <line>/usr/lib/passenger/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'</line>
197
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'</line>
198
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'</line>
199
+ <line>/usr/lib/passenger/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'</line>
200
+ <line>/usr/lib/passenger/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'</line>
201
+ <line>/usr/lib/passenger/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'</line>
202
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:352:in `__send__'</line>
203
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'</line>
204
+ <line>/usr/lib/passenger/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'</line>
205
+ <line>/usr/lib/passenger/bin/passenger-spawn-server:63</line>
206
+ </backtrace>
207
+ </group>
@@ -15,30 +15,39 @@ describe Hoptoad::Error do
15
15
  Hoptoad::Error.error_path(1234).should == "/errors/1234.xml"
16
16
  end
17
17
 
18
- it "should find a page of the 30 most recent errors" do
19
- errors = Hoptoad::Error.find(:all)
20
- ordered = errors.sort_by(&:most_recent_notice_at).reverse
21
- ordered.should == errors
22
- errors.size.should == 30
18
+ describe '.find' do
19
+ it "should find a page of the 30 most recent errors" do
20
+ errors = Hoptoad::Error.find(:all)
21
+ ordered = errors.sort_by(&:most_recent_notice_at).reverse
22
+ ordered.should == errors
23
+ errors.size.should == 30
24
+ end
25
+
26
+ it "should paginate errors" do
27
+ errors = Hoptoad::Error.find(:all, :page => 2)
28
+ ordered = errors.sort_by(&:most_recent_notice_at).reverse
29
+ ordered.should == errors
30
+ errors.size.should == 2
31
+ end
32
+
33
+ it "should find an individual error" do
34
+ error = Hoptoad::Error.find(1696170)
35
+ error.action.should == 'index'
36
+ error.id.should == 1696170
37
+ end
38
+
39
+ it "should raise an error when not passed an id" do
40
+ lambda do
41
+ Hoptoad::Error.find
42
+ end.should raise_error(Hoptoad::HoptoadError)
43
+ end
23
44
  end
24
45
 
25
- it "should paginate errors" do
26
- errors = Hoptoad::Error.find(:all, :page => 2)
27
- ordered = errors.sort_by(&:most_recent_notice_at).reverse
28
- ordered.should == errors
29
- errors.size.should == 2
30
- end
31
-
32
- it "should find an individual error" do
33
- error = Hoptoad::Error.find(1696170)
34
- error.action.should == 'index'
35
- error.id.should == 1696170
36
- end
37
-
38
- it "should raise an error when not passed an id" do
39
- lambda do
40
- Hoptoad::Error.find
41
- end.should raise_error(Hoptoad::HoptoadError)
46
+ describe '.update' do
47
+ it 'should update the status of an error' do
48
+ error = Hoptoad::Error.update(1696170, :group => { :resolved => true})
49
+ error.resolved.should be_true
50
+ end
42
51
  end
43
52
 
44
53
  end
@@ -15,6 +15,7 @@ FakeWeb.allow_net_connect = false
15
15
  FakeWeb.register_uri(:get, "http://myapp.hoptoadapp.com/errors.xml?auth_token=abcdefg123456", :response => File.join(File.dirname(__FILE__), 'fixtures', 'errors.xml'), :content_type => "application/xml; charset=utf-8", :status => ["200", "OK"])
16
16
  FakeWeb.register_uri(:get, "http://myapp.hoptoadapp.com/errors.xml?auth_token=abcdefg123456&page=2", :response => File.join(File.dirname(__FILE__), 'fixtures', 'paginated_errors.xml'), :content_type => "application/xml; charset=utf-8", :status => ["200", "OK"])
17
17
  FakeWeb.register_uri(:get, "http://myapp.hoptoadapp.com/errors/1696170.xml?auth_token=abcdefg123456", :response => File.join(File.dirname(__FILE__), 'fixtures', 'individual_error.xml'), :content_type => "application/xml; charset=utf-8", :status => ["200", "OK"])
18
+ FakeWeb.register_uri(:put, 'http://myapp.hoptoadapp.com/errors/1696170.xml?auth_token=abcdefg123456&group[resolved]=true', :response => File.join(File.dirname(__FILE__), 'fixtures', 'update_error.xml'), :content_type => 'application/xml; charset=utf-8', :status => ['200', 'OK'])
18
19
 
19
20
  # notices
20
21
  FakeWeb.register_uri(:get, "http://myapp.hoptoadapp.com/errors/1696170/notices.xml?auth_token=abcdefg123456", :response => File.join(File.dirname(__FILE__), 'fixtures', 'notices.xml'), :content_type => "application/xml; charset=utf-8", :status => ["200", "OK"])
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hoptoad-api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.3.0
5
+ version: 2.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Steve Agalloco
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-13 00:00:00 -05:00
13
+ date: 2011-05-25 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -142,6 +142,7 @@ files:
142
142
  - spec/fixtures/paginated_errors.xml
143
143
  - spec/fixtures/paginated_notices.xml
144
144
  - spec/fixtures/projects.xml
145
+ - spec/fixtures/update_error.xml
145
146
  - spec/hoptoad_api/error_spec.rb
146
147
  - spec/hoptoad_api/notice_spec.rb
147
148
  - spec/hoptoad_api/project_spec.rb
@@ -171,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
172
  requirements: []
172
173
 
173
174
  rubyforge_project:
174
- rubygems_version: 1.5.0
175
+ rubygems_version: 1.6.1
175
176
  signing_key:
176
177
  specification_version: 3
177
178
  summary: Hoptoad API
@@ -183,6 +184,7 @@ test_files:
183
184
  - spec/fixtures/paginated_errors.xml
184
185
  - spec/fixtures/paginated_notices.xml
185
186
  - spec/fixtures/projects.xml
187
+ - spec/fixtures/update_error.xml
186
188
  - spec/hoptoad_api/error_spec.rb
187
189
  - spec/hoptoad_api/notice_spec.rb
188
190
  - spec/hoptoad_api/project_spec.rb