Sha256: aa64f53aa8e0d09958676a80de41c49c8baaedc5400154e6d16664e329becaae

Contents?: true

Size: 1007 Bytes

Versions: 28

Compression:

Stored size: 1007 Bytes

Contents

require 'test_helper'

class ScreenUsingModel
  include SsciInc::Screening::Model

  attr_accessor :a, :b, :c

end

module SsciInc
  module Screening
    class ModelTest < Test::Unit::TestCase
      subject { ScreenUsingModel.new }

      context "#to_xml" do
        should "call as_xml and to_xml on that object" do
          xml = "<a>woot</a>"
          subject.expects(:as_xml).returns(mock(:to_xml => xml))
          assert_equal xml, subject.to_xml
        end
      end

      context "#builder" do
        should "build a Screening xml node with supplied attributes" do
          node = mock
          attributes = {:a => "a"}
          Nokogiri::XML::Builder.any_instance.expects(:Screening).
                                              with(attributes)
          Nokogiri::XML::Builder.any_instance.expects(:parent => mock(
                                                        :root => node))
          assert_equal node, subject.builder(attributes)
        end
      end

    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ssci_inc-0.1.28 test/unit/screening/model_test.rb
ssci_inc-0.1.27 test/unit/screening/model_test.rb
ssci_inc-0.1.26 test/unit/screening/model_test.rb
ssci_inc-0.1.24 test/unit/screening/model_test.rb
ssci_inc-0.1.23 test/unit/screening/model_test.rb
ssci_inc-0.1.22 test/unit/screening/model_test.rb
ssci_inc-0.1.21 test/unit/screening/model_test.rb
ssci_inc-0.1.20 test/unit/screening/model_test.rb
ssci_inc-0.1.19 test/unit/screening/model_test.rb
ssci_inc-0.1.18 test/unit/screening/model_test.rb
ssci_inc-0.1.17 test/unit/screening/model_test.rb
ssci_inc-0.1.16 test/unit/screening/model_test.rb
ssci_inc-0.1.15 test/unit/screening/model_test.rb
ssci_inc-0.1.14 test/unit/screening/model_test.rb
ssci_inc-0.1.13 test/unit/screening/model_test.rb
ssci_inc-0.1.12 test/unit/screening/model_test.rb
ssci_inc-0.1.11 test/unit/screening/model_test.rb
ssci_inc-0.1.10 test/unit/screening/model_test.rb
ssci_inc-0.1.9 test/unit/screening/model_test.rb
ssci_inc-0.1.8 test/unit/screening/model_test.rb