Sidu,
Below is the backtrace...
MultiJson::DecodeError:
unexpected token at 'loan_request=4000000'
# json/ext/Parser.java:249:in `parse'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
json-1.6.0.1-java/lib/json/common.rb:148:in `parse'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
multi_json-1.0.3/lib/multi_json/engines/json_gem.rb:13:in `decode'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
multi_json-1.0.3/lib/multi_json.rb:65:in `decode'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/json/decoding.rb:12:in `decode'
# ./app/controllers/sec223f_acquisition_controller.rb:13:in
`loan'
# org/jruby/RubyKernel.java:2092:in `send'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/implicit_render.rb:4:in
`send_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/abstract_controller/base.rb:167:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/rendering.rb:10:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/abstract_controller/callbacks.rb:18:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/callbacks.rb:419:in
`_run__1477426868__process_action__693554978__callbacks'
# org/jruby/RubyKernel.java:2092:in `send'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/callbacks.rb:401:in
`_run_process_action_callbacks'
# org/jruby/RubyKernel.java:2096:in `send'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/callbacks.rb:81:in
`run_callbacks'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/abstract_controller/callbacks.rb:17:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/rescue.rb:17:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:30:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/notifications.rb:53:in
`instrument'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:
21:in `instrument'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activesupport-3.1.0/lib/active_support/notifications.rb:53:in
`instrument'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:29:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/params_wrapper.rb:201:in
`process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
activerecord-3.1.0/lib/active_record/railties/controller_runtime.rb:
18:in `process_action'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/abstract_controller/base.rb:121:in `process'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/abstract_controller/rendering.rb:45:in `process'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/metal/testing.rb:17:in
`process_with_new_base_test'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/test_case.rb:449:in `process'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/test_case.rb:49:in `process'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/
actionpack-3.1.0/lib/action_controller/test_case.rb:370:in `post'
# ./spec/controllers/sec223f_acquisition_controller_spec.rb:13:in
`(root)'
# org/jruby/RubyKernel.java:2061:in `instance_eval'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/example.rb:48:in `run'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/example.rb:107:in `with_around_hooks'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/example.rb:45:in `run'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/example_group.rb:294:in `run_examples'
# org/jruby/RubyArray.java:2336:in `collect'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/example_group.rb:290:in `run_examples'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/example_group.rb:262:in `run'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/command_line.rb:24:in `run'
# org/jruby/RubyArray.java:2336:in `collect'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/command_line.rb:24:in `run'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/reporter.rb:12:in `report'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/command_line.rb:21:in `run'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
# /Users/gallagher/.rvm/gems/jruby-1.6.3@rails310/gems/rspec-
core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
On Nov 6, 12:56 pm, Sidu Ponnappa <
ckponna...@gmail.com> wrote:
> Take a look athttps://
github.com/c42/goldberg/tree/master/spec/controllers
>
> If you're getting a 500, it's no fault of your tests - if you can
> throw in the stack trace that accompanies that 500 is your test.log, I
> could help you further.
>
> Best,
> Sidu Ponnappa.http://c42.inhttp://
rubymonk.com
>
> On 6 November 2011 20:44, G-man <
gallagher.po...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Sidu,
>
> > Thanks for confirming the utility of functional testing (a la RSpec)
> > for JSON APIs, and I shall explore rspec-http.
>
> > Unfortunately, I'm still stuck on the problem I outlined above. If you
> > or anyone would be so kind as to include a snippet of something
> > similar so I can determine my obstacle(s), it would be greatly
> > appreciated.
>
> > G
>
> > On Nov 6, 3:47 am, Sidu Ponnappa <
ckponna...@gmail.com> wrote:
> >> I've had a fairly good experience simply by using rspec controller tests
> >> and a json parser.
>
> >> For stateless apis this is usually sufficient.
>
> >> You could also take a look athttp://
github.com/c42/rspec-httptohelp test