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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +0 -1
- data/lib/roust/ticket.rb +1 -1
- data/lib/roust/version.rb +1 -1
- data/spec/mocks/ticket-101-comment.txt +3 -0
- data/spec/mocks/ticket-101-show.txt +19 -0
- data/spec/roust/ticket_spec.rb +23 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed66730b4007fa70d2a1ea1dc0e4a007440e8fc6
|
4
|
+
data.tar.gz: d1fe3883e3bbe144d420123a18d60eedf3b6009d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3b5f2b22b25f176b62084fc4d4347cf270069ff3f3e5d89a87aea957c6031a9a310cf19869a6795afa9ef0d9d35f249912dfa352644e979952771625ebd0bc8
|
7
|
+
data.tar.gz: c80f740de9bef797e1c424adc46aed98d19de4ee763d334ee2cc8951f2db39da21c7faa4ec470c20f74121544fc5e5a2cb665cf3a58fa546ef85f63462e56d81
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
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
@@ -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
|
data/spec/roust/ticket_spec.rb
CHANGED
@@ -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.
|
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-
|
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
|