twilio-test-toolkit-alt 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +265 -0
- data/Rakefile +38 -0
- data/lib/twilio-test-toolkit.rb +4 -0
- data/lib/twilio-test-toolkit/call_in_progress.rb +48 -0
- data/lib/twilio-test-toolkit/call_scope.rb +247 -0
- data/lib/twilio-test-toolkit/dsl.rb +15 -0
- data/lib/twilio-test-toolkit/version.rb +3 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/twilio_controller.rb +12 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/twilio.layout.xml.erb +4 -0
- data/spec/dummy/app/views/twilio/test_action.xml.erb +2 -0
- data/spec/dummy/app/views/twilio/test_call_status.xml.erb +6 -0
- data/spec/dummy/app/views/twilio/test_dial_with_action.xml.erb +3 -0
- data/spec/dummy/app/views/twilio/test_dial_with_no_action.xml.erb +3 -0
- data/spec/dummy/app/views/twilio/test_dial_with_sip.xml +6 -0
- data/spec/dummy/app/views/twilio/test_gather_finish_on_asterisk.xml.erb +3 -0
- data/spec/dummy/app/views/twilio/test_hangup.xml.erb +1 -0
- data/spec/dummy/app/views/twilio/test_play.xml.erb +1 -0
- data/spec/dummy/app/views/twilio/test_record.xml +2 -0
- data/spec/dummy/app/views/twilio/test_redirect.xml.erb +1 -0
- data/spec/dummy/app/views/twilio/test_say.xml.erb +1 -0
- data/spec/dummy/app/views/twilio/test_start.xml.erb +5 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +17 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +16 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +20546 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/requests/call_scope_spec.rb +399 -0
- data/spec/requests/dsl_spec.rb +69 -0
- data/spec/spec_helper.rb +20 -0
- metadata +264 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe TwilioTestToolkit::DSL do
|
4
|
+
before(:each) do
|
5
|
+
@our_number = "2065551212"
|
6
|
+
@their_number = "2065553434"
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "ttt_call" do
|
10
|
+
describe "basics" do
|
11
|
+
before(:each) do
|
12
|
+
@call = ttt_call(test_start_twilio_index_path, @our_number, @their_number)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should assign the call" do
|
16
|
+
@call.should_not be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should have a sid" do
|
20
|
+
@call.sid.should_not be_blank
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should default the method to post" do
|
24
|
+
@call.http_method.should == :post
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should have the right properties" do
|
28
|
+
@call.initial_path.should == test_start_twilio_index_path
|
29
|
+
@call.from_number.should == @our_number
|
30
|
+
@call.to_number.should == @their_number
|
31
|
+
@call.is_machine.should be_false
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "with a sid, method and machine override" do
|
36
|
+
before(:each) do
|
37
|
+
@mysid = "1234567"
|
38
|
+
@call = ttt_call(test_start_twilio_index_path, @our_number, @their_number, :call_sid => @mysid, :is_machine => true, :method => :get)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should have the right sid" do
|
42
|
+
@call.sid.should == @mysid
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should be a machine call" do
|
46
|
+
@call.is_machine.should be_true
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should be a get call" do
|
50
|
+
@call.http_method.should == :get
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "with a called and direction" do
|
55
|
+
before(:each) do
|
56
|
+
@direction = 'outbound-api'
|
57
|
+
@call = ttt_call(test_start_twilio_index_path, @our_number, @their_number, :direction => @direction, :called => @their_number)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should have the right direction" do
|
61
|
+
@call.direction.should == @direction
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should have the right called number" do
|
65
|
+
@call.called.should == @their_number
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
require 'rspec/rails'
|
10
|
+
|
11
|
+
# Set up capybara integration
|
12
|
+
require 'capybara/rspec'
|
13
|
+
require 'capybara/rails'
|
14
|
+
|
15
|
+
# Our gem
|
16
|
+
require 'twilio-test-toolkit'
|
17
|
+
|
18
|
+
RSpec.configure do |config|
|
19
|
+
config.include TwilioTestToolkit::DSL, :type => :request
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,264 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: twilio-test-toolkit-alt
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.4.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jack Nichols
|
8
|
+
- Patrick Gibson
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: capybara
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: uuidtools
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rails
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 3.2.12
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 3.2.12
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: sqlite3
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: sqlite3-ruby
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rspec-rails
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: jquery-rails
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
description: Better integration tests for apps that use Twilio. This is an alternate
|
127
|
+
version of the original JMongol version.
|
128
|
+
email:
|
129
|
+
- jack@jmongol.com
|
130
|
+
executables: []
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- MIT-LICENSE
|
135
|
+
- README.md
|
136
|
+
- Rakefile
|
137
|
+
- lib/twilio-test-toolkit.rb
|
138
|
+
- lib/twilio-test-toolkit/call_in_progress.rb
|
139
|
+
- lib/twilio-test-toolkit/call_scope.rb
|
140
|
+
- lib/twilio-test-toolkit/dsl.rb
|
141
|
+
- lib/twilio-test-toolkit/version.rb
|
142
|
+
- spec/dummy/README.rdoc
|
143
|
+
- spec/dummy/Rakefile
|
144
|
+
- spec/dummy/app/assets/javascripts/application.js
|
145
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
146
|
+
- spec/dummy/app/controllers/application_controller.rb
|
147
|
+
- spec/dummy/app/controllers/twilio_controller.rb
|
148
|
+
- spec/dummy/app/helpers/application_helper.rb
|
149
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
150
|
+
- spec/dummy/app/views/layouts/twilio.layout.xml.erb
|
151
|
+
- spec/dummy/app/views/twilio/test_action.xml.erb
|
152
|
+
- spec/dummy/app/views/twilio/test_call_status.xml.erb
|
153
|
+
- spec/dummy/app/views/twilio/test_dial_with_action.xml.erb
|
154
|
+
- spec/dummy/app/views/twilio/test_dial_with_no_action.xml.erb
|
155
|
+
- spec/dummy/app/views/twilio/test_dial_with_sip.xml
|
156
|
+
- spec/dummy/app/views/twilio/test_gather_finish_on_asterisk.xml.erb
|
157
|
+
- spec/dummy/app/views/twilio/test_hangup.xml.erb
|
158
|
+
- spec/dummy/app/views/twilio/test_play.xml.erb
|
159
|
+
- spec/dummy/app/views/twilio/test_record.xml
|
160
|
+
- spec/dummy/app/views/twilio/test_redirect.xml.erb
|
161
|
+
- spec/dummy/app/views/twilio/test_say.xml.erb
|
162
|
+
- spec/dummy/app/views/twilio/test_start.xml.erb
|
163
|
+
- spec/dummy/config.ru
|
164
|
+
- spec/dummy/config/application.rb
|
165
|
+
- spec/dummy/config/boot.rb
|
166
|
+
- spec/dummy/config/database.yml
|
167
|
+
- spec/dummy/config/environment.rb
|
168
|
+
- spec/dummy/config/environments/development.rb
|
169
|
+
- spec/dummy/config/environments/production.rb
|
170
|
+
- spec/dummy/config/environments/test.rb
|
171
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
172
|
+
- spec/dummy/config/initializers/inflections.rb
|
173
|
+
- spec/dummy/config/initializers/mime_types.rb
|
174
|
+
- spec/dummy/config/initializers/secret_token.rb
|
175
|
+
- spec/dummy/config/initializers/session_store.rb
|
176
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
177
|
+
- spec/dummy/config/locales/en.yml
|
178
|
+
- spec/dummy/config/routes.rb
|
179
|
+
- spec/dummy/db/development.sqlite3
|
180
|
+
- spec/dummy/db/schema.rb
|
181
|
+
- spec/dummy/db/test.sqlite3
|
182
|
+
- spec/dummy/log/test.log
|
183
|
+
- spec/dummy/public/404.html
|
184
|
+
- spec/dummy/public/422.html
|
185
|
+
- spec/dummy/public/500.html
|
186
|
+
- spec/dummy/public/favicon.ico
|
187
|
+
- spec/dummy/script/rails
|
188
|
+
- spec/requests/call_scope_spec.rb
|
189
|
+
- spec/requests/dsl_spec.rb
|
190
|
+
- spec/spec_helper.rb
|
191
|
+
homepage: https://github.com/pgib/twilio-test-toolkit
|
192
|
+
licenses:
|
193
|
+
- MIT
|
194
|
+
metadata: {}
|
195
|
+
post_install_message:
|
196
|
+
rdoc_options: []
|
197
|
+
require_paths:
|
198
|
+
- lib
|
199
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
requirements: []
|
210
|
+
rubyforge_project:
|
211
|
+
rubygems_version: 2.2.3
|
212
|
+
signing_key:
|
213
|
+
specification_version: 4
|
214
|
+
summary: Better integration tests for apps that use Twilio
|
215
|
+
test_files:
|
216
|
+
- spec/dummy/app/assets/javascripts/application.js
|
217
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
218
|
+
- spec/dummy/app/controllers/application_controller.rb
|
219
|
+
- spec/dummy/app/controllers/twilio_controller.rb
|
220
|
+
- spec/dummy/app/helpers/application_helper.rb
|
221
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
222
|
+
- spec/dummy/app/views/layouts/twilio.layout.xml.erb
|
223
|
+
- spec/dummy/app/views/twilio/test_action.xml.erb
|
224
|
+
- spec/dummy/app/views/twilio/test_call_status.xml.erb
|
225
|
+
- spec/dummy/app/views/twilio/test_dial_with_action.xml.erb
|
226
|
+
- spec/dummy/app/views/twilio/test_dial_with_no_action.xml.erb
|
227
|
+
- spec/dummy/app/views/twilio/test_dial_with_sip.xml
|
228
|
+
- spec/dummy/app/views/twilio/test_gather_finish_on_asterisk.xml.erb
|
229
|
+
- spec/dummy/app/views/twilio/test_hangup.xml.erb
|
230
|
+
- spec/dummy/app/views/twilio/test_play.xml.erb
|
231
|
+
- spec/dummy/app/views/twilio/test_record.xml
|
232
|
+
- spec/dummy/app/views/twilio/test_redirect.xml.erb
|
233
|
+
- spec/dummy/app/views/twilio/test_say.xml.erb
|
234
|
+
- spec/dummy/app/views/twilio/test_start.xml.erb
|
235
|
+
- spec/dummy/config/application.rb
|
236
|
+
- spec/dummy/config/boot.rb
|
237
|
+
- spec/dummy/config/database.yml
|
238
|
+
- spec/dummy/config/environment.rb
|
239
|
+
- spec/dummy/config/environments/development.rb
|
240
|
+
- spec/dummy/config/environments/production.rb
|
241
|
+
- spec/dummy/config/environments/test.rb
|
242
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
243
|
+
- spec/dummy/config/initializers/inflections.rb
|
244
|
+
- spec/dummy/config/initializers/mime_types.rb
|
245
|
+
- spec/dummy/config/initializers/secret_token.rb
|
246
|
+
- spec/dummy/config/initializers/session_store.rb
|
247
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
248
|
+
- spec/dummy/config/locales/en.yml
|
249
|
+
- spec/dummy/config/routes.rb
|
250
|
+
- spec/dummy/config.ru
|
251
|
+
- spec/dummy/db/development.sqlite3
|
252
|
+
- spec/dummy/db/schema.rb
|
253
|
+
- spec/dummy/db/test.sqlite3
|
254
|
+
- spec/dummy/log/test.log
|
255
|
+
- spec/dummy/public/404.html
|
256
|
+
- spec/dummy/public/422.html
|
257
|
+
- spec/dummy/public/500.html
|
258
|
+
- spec/dummy/public/favicon.ico
|
259
|
+
- spec/dummy/Rakefile
|
260
|
+
- spec/dummy/README.rdoc
|
261
|
+
- spec/dummy/script/rails
|
262
|
+
- spec/requests/call_scope_spec.rb
|
263
|
+
- spec/requests/dsl_spec.rb
|
264
|
+
- spec/spec_helper.rb
|