Sha256: dd6f2ad4924c62acdeb3dafa6db682754d945feafdc2d4a65e887a419f003532

Contents?: true

Size: 744 Bytes

Versions: 2

Compression:

Stored size: 744 Bytes

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe <%= "#{appname.camelcase}::#{request_class}" %> do

  it "creates xml" do
    <%= request_class.underscore %> = <%= request_class %>.new({
      # :attribute => value
    })
    xml = <%= request_class.underscore %>.to_xml_etc
    xml.should =~ /\<\?xml/
  end
  
  # run "DO_IT_LIVE=true spec spec" to contact the api
  if ENV['DO_IT_LIVE']
    
    it "contacts the live api and returns <%= response_class %> instance(s)" do
      $DEBUG = true # spit out xml for the request & response
      
      <%= response_class.underscore %> = <%= request_class %>.new({
        # :attribute => "value"
      }).do
      <%= response_class.underscore %>.should_not be_blank
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
woahdae-consumer-0.8.1 consumer_generators/request/templates/spec/request_spec.rb
woahdae-consumer-0.8.2 consumer_generators/request/templates/spec/request_spec.rb