roust 1.8.2 → 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66c9350b75b1aac09b2b1d5c17401654d9b336bb
4
- data.tar.gz: 2255b4b1690b40658e610c0b52ced4cd8de75e97
3
+ metadata.gz: ed66730b4007fa70d2a1ea1dc0e4a007440e8fc6
4
+ data.tar.gz: d1fe3883e3bbe144d420123a18d60eedf3b6009d
5
5
  SHA512:
6
- metadata.gz: 01fd887c2725ef17cc14873c5677c3d7991e3c4fdeb7f3252ad1e59c72485a3b335b3e1a973f8f75c76e17a4d7bcc74de62697aa7ab4539a698ad44babe5b8bf
7
- data.tar.gz: 94a0c365649b4ccbe28b417877223ada824fbae37d3e4a84c7fea8f0c2829b0e32ebfa01b6ac2bc40048315b4257f96c5fbf4858bc0eb069348db144360b255c
6
+ metadata.gz: c3b5f2b22b25f176b62084fc4d4347cf270069ff3f3e5d89a87aea957c6031a9a310cf19869a6795afa9ef0d9d35f249912dfa352644e979952771625ebd0bc8
7
+ data.tar.gz: c80f740de9bef797e1c424adc46aed98d19de4ee763d334ee2cc8951f2db39da21c7faa4ec470c20f74121544fc5e5a2cb665cf3a58fa546ef85f63462e56d81
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roust (1.8.2)
4
+ roust (1.8.3)
5
5
  activesupport (>= 4.0.10)
6
6
  httparty (>= 0.13.1)
7
7
  mail (>= 2.5.4)
data/README.md CHANGED
@@ -144,5 +144,4 @@ TODO
144
144
  ----
145
145
 
146
146
  - Links CRUD (linking tickets to one another)
147
- - Ticket comment + correspondence
148
147
  - Attachment fetching
data/lib/roust/ticket.rb CHANGED
@@ -100,7 +100,7 @@ class Roust
100
100
  body, _ = explode_response(response)
101
101
 
102
102
  case body
103
- when /^# Message recorded/
103
+ when /^# (Message recorded|Comments added)/
104
104
  ticket_show(id)
105
105
  when /^# You are not allowed to modify ticket \d+/
106
106
  raise Unauthorized, body
data/lib/roust/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Roust
2
- VERSION = '1.8.2'
2
+ VERSION = '1.8.3'
3
3
  end
@@ -0,0 +1,3 @@
1
+ RT/4.2.8 200 Ok
2
+
3
+ # Comments added
@@ -0,0 +1,19 @@
1
+ RT/3.4.6 200 Ok
2
+
3
+ id: ticket/101
4
+ Queue: sales
5
+ Subject: test ticket
6
+ Status: new
7
+ Priority: 101
8
+ InitialPriority: 101
9
+ FinalPriority: 100
10
+ Created: Tue Dec 11 07:59:31 2012
11
+ Starts: Not set
12
+ Started: Not set
13
+ Due: Wed Dec 12 20:58:48 2012
14
+ Resolved: Wed Jan 16 16:33:15 2013
15
+ Told: Mon Jan 07 15:27:09 2013
16
+ LastUpdated: Wed Nov 06 09:33:43 2013
17
+ TimeEstimated: 0
18
+ TimeWorked: 12 hours
19
+ TimeLeft: 0
@@ -75,6 +75,21 @@ describe Roust do
75
75
  :body => mocks_path.join('ticket-100-show.txt').read,
76
76
  :headers => {})
77
77
 
78
+ stub_request(:post, "http://rt.example.org/REST/1.0/ticket/101/comment")
79
+ .with { |request|
80
+ query = WebMock::Util::QueryMapper.query_to_values(request.body)
81
+ require 'pry'
82
+
83
+ true
84
+ }.to_return(:status => 200,
85
+ :body => mocks_path.join('ticket-101-comment.txt').read,
86
+ :headers => {})
87
+
88
+ stub_request(:get, 'http://rt.example.org/REST/1.0/ticket/101/show')
89
+ .to_return(:status => 200,
90
+ :body => mocks_path.join('ticket-101-show.txt').read,
91
+ :headers => {})
92
+
78
93
  stub_request(:get, "http://rt.example.org/REST/1.0/ticket/150/links")
79
94
  .to_return(:status => 200,
80
95
  :body => mocks_path.join('ticket-150-links.txt').read,
@@ -229,6 +244,14 @@ describe Roust do
229
244
  query['content'] =~ /Action: comment/ &&
230
245
  query['content'] =~ /Text: this is a test comment/
231
246
  }
247
+ ticket = @rt.ticket_comment(101, attrs)
248
+
249
+ expect(WebMock).to have_requested(:post, "rt.example.org/REST/1.0/ticket/101/comment")
250
+ .with { |request|
251
+ query = WebMock::Util::QueryMapper.query_to_values(request.body)
252
+ query['content'] =~ /Action: comment/ &&
253
+ query['content'] =~ /Text: this is a test comment/
254
+ }
232
255
  end
233
256
 
234
257
  it 'can correspond on a ticket' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roust
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -87,6 +87,8 @@ files:
87
87
  - spec/mocks/ticket-100-comment.txt
88
88
  - spec/mocks/ticket-100-show.txt
89
89
  - spec/mocks/ticket-100-update.txt
90
+ - spec/mocks/ticket-101-comment.txt
91
+ - spec/mocks/ticket-101-show.txt
90
92
  - spec/mocks/ticket-150-links-update.txt
91
93
  - spec/mocks/ticket-150-links.txt
92
94
  - spec/mocks/ticket-151-links-update.txt
@@ -142,6 +144,8 @@ test_files:
142
144
  - spec/mocks/ticket-100-comment.txt
143
145
  - spec/mocks/ticket-100-show.txt
144
146
  - spec/mocks/ticket-100-update.txt
147
+ - spec/mocks/ticket-101-comment.txt
148
+ - spec/mocks/ticket-101-show.txt
145
149
  - spec/mocks/ticket-150-links-update.txt
146
150
  - spec/mocks/ticket-150-links.txt
147
151
  - spec/mocks/ticket-151-links-update.txt