Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test wash_out controller with Rspec

I have implemented a Rails controller with the wash_out gem.

My controller look like this:

class TestController < ApplicationController
  include WashOut::SOAP

  soap_action "int_to_string",
              :args   => :integer,
              :return => :string
  def int_to_string
    render :soap => params[:value].to_s
  end
end

routes.rb:

MyApp::Application.routes.draw do
  wash_out :test
end

I am not sure how I can test this controller with Rspec.

Any ideas?

like image 608
omergk Avatar asked Nov 04 '22 20:11

omergk


1 Answers

In this link you can find a good aproach

http://blog.johnsonch.com/2013/04/18/rails-3-soap-and-testing-oh-my/

The aproach is:

  • Create a client with savonrb gem
  • compare the result in your test
like image 69
oaamados Avatar answered Nov 09 '22 11:11

oaamados