Sha256: 1b2e8f7ad294fcaf70a46ffcced56c1db7b09e73f622f85cb0168ed9649a3de1

Contents?: true

Size: 667 Bytes

Versions: 7

Compression:

Stored size: 667 Bytes

Contents

require 'spec_helper'

describe APIMatchers::ResponseBody::HaveNode do
  describe "in json" do
    before do
      APIMatchers.setup { |config| config.have_node_matcher = :json }
    end

    it "should parse the matcher for json" do
      { :product => 'chat' }.to_json.should have_node(:product).with('chat')
    end
  end

  describe "in xml" do
    before do
      APIMatchers.setup { |config| config.have_node_matcher = :xml }
    end

    it "should parse the matcher for xml" do
      "<product>chat</product>".should have_node(:product).with('chat')
    end

    after do
      APIMatchers.setup { |config| config.have_node_matcher = :json }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
api_matchers-0.4.0 spec/api_matchers/response_body/have_node_spec.rb
api_matchers-0.3.0 spec/api_matchers/response_body/have_node_spec.rb
api_matchers-0.2.0 spec/api_matchers/response_body/have_node_spec.rb
api_matchers-0.1.1 spec/api_matchers/response_body/have_node_spec.rb
api_matchers-0.1.0 spec/api_matchers/response_body/have_node_spec.rb
api_matchers-0.0.2 spec/api_matchers/response_body/have_node_spec.rb
api_matchers-0.0.1 spec/api_matchers/response_body/have_node_spec.rb