1

I am currently trying to do a post request whilst using typheous and hyrda. I am using VCR gem for testing the response.

I am currently getting the following error: ArgumentError: comparison of Array with Array failed When I run this line: hydra.run

My request is as follows:

<Typhoeus::Request:0x007fb7523a8688 @base_url="http://dev.moodle.co.za/webservice/rest/server.php?", @original_options={:method=>:get, :params=>{:wstoken=>"7d7ed6cc23c8143e4baaa39b51", :moodlewsrestformat=>"json", :wsfunction=>"enrol_manual_enrol_users ", :enrolments=>{"0"=>{:roleid=>5, :userid=>61, :courseid=>96}}}, :headers=>{:Accept=>"json"}}, @options={:method=>:get, :params=>{:wstoken=>"7d7ed6cc23c8143e4baaa39b515b10af", :moodlewsrestformat=>"json", :wsfunction=>"enrol_manual_enrol_users ", :enrolments=>{"0"=>{:roleid=>5, :userid=>61, :courseid=>96}}}, :headers=>{"User-Agent"=>"Typhoeus - https://github.com/typhoeus/typhoeus", :Accept=>"json"}, :maxredirs=>50}>

if i remove userid and course id it works fine but as soon as [0] has more thean one array member i get the above mentioned error.

Also if I remove VCR gem then it works fine.

Any advice how to solve this

Failure/Error: expect(person.moodle_create_user()).to eq(["id"=>"5nasCrYKc5", "username"=>"testing_moodle_gem"])
     ArgumentError:
       comparison of Array with Array failed
     # ./lib/moodle/request.rb:31:in `run_request'
     # ./lib/moodle/request.rb:14:in `execute_request'
     # ./lib/moodle/request.rb:19:in `execute_and_return_response_body'
     # ./lib/moodle/person.rb:11:in `moodle_create_user'
     # ./spec/moodle/person_spec.rb:30:in `block (4 levels) in <top (required)>'
     # ./spec/moodle/person_spec.rb:29:in `block (3 levels) in <top (required)>'
phoet
  • 18,688
  • 4
  • 46
  • 74
Andrew_tainton
  • 261
  • 1
  • 3
  • 13

0 Answers0