Created
July 17, 2012 06:24
-
-
Save davetapley/3127578 to your computer and use it in GitHub Desktop.
Rspec showing savon_spec is unable to work with a class which extends Savon::Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
require 'savon_spec' | |
RSpec.configure do |config| | |
config.include Savon::Spec::Macros | |
end | |
describe 'with client' do | |
let(:client) do | |
Savon::Client.new do | |
wsdl.endpoint = "http://service.example.com" | |
wsdl.namespace = "http://users.service.example.com" | |
end | |
end | |
before do | |
savon.expects(:get_user) | |
end | |
it 'mocks a SOAP request' do | |
client.request(:get_user) | |
end | |
end | |
class ExtendsSavonModel | |
extend Savon::Model | |
document "http://service.example.com?wsdl" | |
def self.get_user_class | |
client.request(:get_user) | |
end | |
def get_user_instance | |
client.request(:get_user) | |
end | |
end | |
describe 'with model' do | |
before do | |
savon.expects(:get_user) | |
end | |
it 'mocks a SOAP request for an instance method' do | |
ExtendsSavonModel.get_user_class | |
end | |
it 'mocks a SOAP request for an class method' do | |
ExtendsSavonModel.new.get_user_instance | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you ever figure out how to fix this?