Sha256: a7a1cebddb9da29bdacbcad5954356e3342ae15f878fb78d4a8665d615748bd8

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'active_record'

describe "ActiveRecord" do
  describe "integration" do
    before :each do
      class MySaxModel < ActiveRecord::Base
        SAXMachine.configure(MySaxModel) do |c|
          c.element :title
        end
      end
    end

    after :each do
      Object.send(:remove_const, :MySaxModel)
    end

    it "parses document" do
      document = MySaxModel.parse("<xml><title>My Title</title></xml>")
      expect(document.title).to eq("My Title")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sax-machine-0.3.0 spec/sax-machine/sax_activerecord_spec.rb