Sha256: 644428dd079cce0d6a2cbebb5949b6f3e786615d90ec38a7f73f6935c93632c2

Contents?: true

Size: 507 Bytes

Versions: 10

Compression:

Stored size: 507 Bytes

Contents

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

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

  after 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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sax-machine-1.3.2 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.3.1 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.3.0 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.2.0 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.1.1 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.1.0 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.0.3 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.0.2 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.0.1 spec/sax-machine/sax_activerecord_spec.rb
sax-machine-1.0.0 spec/sax-machine/sax_activerecord_spec.rb