spec/lita/handlers/eval_spec.rb in lita-eval-0.1.0 vs spec/lita/handlers/eval_spec.rb in lita-eval-0.2.0

- old
+ new

@@ -1,11 +1,11 @@ require 'spec_helper' describe Lita::Handlers::Eval, lita_handler: true do it 'evaluates the code' do - stub_request(:post, 'http://eval.so/api/evaluate') - .with(body: MultiJson.dump(language: 'ruby', code: 'p(2 + 2)')) - .to_return(status: 200, body: MultiJson.dump(stdout: "4\n")) + stub_request(:put, 'http://tryruby.org/levels/1/challenges/0/play') + .with(body: {cmd: '2 + 2'}) + .to_return(status: 200, body: MultiJson.dump(output: '4')) send_command('eval 2 + 2') expect(replies.last).to eq('4') end end