cpi-event-connector 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cpi-event-connector (0.3.0)
4
+ cpi-event-connector (0.4.0)
5
5
  activesupport (~> 3.0)
6
6
  bunny (~> 0.8.0)
7
7
  nokogiri (~> 1.5)
@@ -17,8 +17,10 @@ GEM
17
17
  diff-lcs (1.1.3)
18
18
  i18n (0.6.1)
19
19
  justinf-unification_assertion (0.0.2)
20
+ mini_portile (0.5.0)
20
21
  multi_json (1.7.6)
21
- nokogiri (1.5.9)
22
+ nokogiri (1.6.0)
23
+ mini_portile (~> 0.5.0)
22
24
  rspec (2.8.0)
23
25
  rspec-core (~> 2.8.0)
24
26
  rspec-expectations (~> 2.8.0)
@@ -46,7 +46,9 @@ module Cpi
46
46
  xml.event_type event_type
47
47
  xml.source_tenant_uid source_tenant_uid
48
48
  }
49
- xml.content content
49
+ xml.content do
50
+ xml << content
51
+ end
50
52
  }
51
53
  end
52
54
  builder.doc.root.to_xml
@@ -1,3 +1,3 @@
1
1
  module Cpi
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -94,8 +94,9 @@ describe Cpi::EventConnector do
94
94
  </header>
95
95
  <content>some content</content>
96
96
  </cpi_event>
97
- XML
98
- h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml.strip, "uid" => 'unique_id'})
97
+ XML
98
+
99
+ h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml, "uid" => 'unique_id'})
99
100
  end
100
101
 
101
102
  it "send_event works when given xml" do
@@ -112,7 +113,7 @@ describe Cpi::EventConnector do
112
113
  Cpi::EventConnector.send_event(xml, :queue => 'system_queue_name')
113
114
 
114
115
  h = get_event_from_rabbimq("system_queue_name")
115
- h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml, "uid" => 'unique_id'})
116
+ h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml.strip, "uid" => 'unique_id'})
116
117
  end
117
118
  end
118
119
 
@@ -48,6 +48,24 @@ describe Cpi::Event do
48
48
  <source_tenant_uid>tenant_uid</source_tenant_uid>
49
49
  </header>
50
50
  <content>some content</content>
51
+ </cpi_event>
52
+ XML
53
+ event.xml.should == xml.strip
54
+ end
55
+
56
+ it "uses nokogiri xml as content" do
57
+ event = Cpi::Event.new(event_type: 'type', source_tenant_uid: 'tenant_uid', event_uid: 'uid', content: "<test>test</test>")
58
+
59
+ xml = <<-XML
60
+ <cpi_event>
61
+ <header>
62
+ <event_uid>uid</event_uid>
63
+ <event_type>type</event_type>
64
+ <source_tenant_uid>tenant_uid</source_tenant_uid>
65
+ </header>
66
+ <content>
67
+ <test>test</test>
68
+ </content>
51
69
  </cpi_event>
52
70
  XML
53
71
  event.xml.should == xml.strip
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpi-event-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-06 00:00:00.000000000 Z
12
+ date: 2013-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec