howitzer 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -4
- data/CHANGELOG.md +8 -2
- data/Gemfile +1 -1
- data/howitzer.gemspec +3 -1
- data/lib/howitzer/capybara/settings.rb +2 -2
- data/lib/howitzer/email.rb +2 -2
- data/lib/howitzer/mailgun/client.rb +18 -1
- data/lib/howitzer/version.rb +1 -1
- data/spec/unit/lib/capybara/settings_spec.rb +1 -14
- data/spec/unit/lib/email_spec.rb +16 -3
- data/spec/unit/lib/mailgun/response_spec.rb +2 -3
- metadata +35 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 822093c8e01134d6819f07781fcfc9533ec21191
|
4
|
+
data.tar.gz: b6081c2e41b5c78b2c6cdbdb31e088021c9b1cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1374d0e20e3ffeeb0ac2feb61680b1edfef288cb56554b624adf2307e9f27b264111047692393ea117c4f60aebc4cd3fcdfab0810abaabeed1dd3b680063f779
|
7
|
+
data.tar.gz: 63bf664720ec9d50af9b3d0118dae1f7669ae4f0c47de50a589675fa86e3787528f95a33b06f77e0bb8b40c307c0858c2594f027dd4b135c009b08c7e35a0ce7
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
## [In git](https://github.com/strongqa/howitzer/compare/v1.1.
|
1
|
+
## [In git](https://github.com/strongqa/howitzer/compare/v1.1.1...master)
|
2
2
|
|
3
3
|
### New Features
|
4
4
|
|
5
5
|
### Bugfixes
|
6
6
|
|
7
|
+
## [v1.1.1](https://github.com/strongqa/howitzer/compare/v1.1.0...v1.1.1)
|
8
|
+
|
9
|
+
### Bugfixes
|
10
|
+
- fixed problem with Mailgun
|
11
|
+
- fixed problems with gems
|
12
|
+
|
7
13
|
## [v1.1.0](https://github.com/strongqa/howitzer/compare/v1.0.2...v1.1.0)
|
8
14
|
|
9
15
|
### New Features
|
@@ -67,7 +73,7 @@ It is major release, so there are many new features, refactoring, unit tests, co
|
|
67
73
|
|
68
74
|
### Bugfixes
|
69
75
|
|
70
|
-
* Fixed problem with dependencies
|
76
|
+
* Fixed problem with dependencies
|
71
77
|
|
72
78
|
## [v0.0.1](https://github.com/strongqa/howitzer/tree/v0.0.1)
|
73
79
|
|
data/Gemfile
CHANGED
data/howitzer.gemspec
CHANGED
@@ -19,6 +19,8 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.required_ruby_version = '>= 1.9.3'
|
20
20
|
|
21
21
|
gem.add_runtime_dependency 'nokogiri', '~> 1.6' if gem.platform.to_s =~ /mswin|mingw/
|
22
|
+
gem.add_runtime_dependency 'rack', '~> 1.0'
|
23
|
+
gem.add_runtime_dependency 'tins', '1.6.0'
|
22
24
|
gem.add_runtime_dependency 'rake'
|
23
25
|
gem.add_runtime_dependency 'gli'
|
24
26
|
gem.add_runtime_dependency 'syntax'
|
@@ -28,7 +30,7 @@ Gem::Specification.new do |gem|
|
|
28
30
|
gem.add_runtime_dependency 'repeater'
|
29
31
|
gem.add_runtime_dependency 'launchy'
|
30
32
|
gem.add_runtime_dependency 'log4r', '~>1.1.10'
|
31
|
-
gem.add_runtime_dependency 'rest-client'
|
33
|
+
gem.add_runtime_dependency 'rest-client', '~>1.8'
|
32
34
|
gem.add_runtime_dependency 'poltergeist'
|
33
35
|
gem.add_runtime_dependency 'rawler'
|
34
36
|
gem.add_runtime_dependency 'capybara'
|
@@ -325,7 +325,7 @@ module Capybara
|
|
325
325
|
Capybara.run_server = false
|
326
326
|
Capybara.app_host = ''
|
327
327
|
Capybara.asset_host = app_base_url
|
328
|
-
Capybara.
|
328
|
+
Capybara.default_max_wait_time = settings.timeout_small
|
329
329
|
Capybara.ignore_hidden_elements = true
|
330
330
|
Capybara.visible_text_only = true
|
331
331
|
Capybara.match = :one
|
@@ -340,4 +340,4 @@ end
|
|
340
340
|
|
341
341
|
# @deprecated
|
342
342
|
#
|
343
|
-
CapybaraSettings = Capybara::Settings
|
343
|
+
CapybaraSettings = Capybara::Settings
|
data/lib/howitzer/email.rb
CHANGED
@@ -46,7 +46,7 @@ class Email
|
|
46
46
|
hash['message']['recipients'].first == recipient && hash['message']['headers']['subject'] == subject
|
47
47
|
end
|
48
48
|
if event
|
49
|
-
message = Mailgun::Connector.instance.client.
|
49
|
+
message = Mailgun::Connector.instance.client.get_url(event['storage']['url']).to_h
|
50
50
|
else
|
51
51
|
raise Howitzer::EmailNotFoundError.new('Message not received yet, retry...')
|
52
52
|
end
|
@@ -131,4 +131,4 @@ class Email
|
|
131
131
|
end
|
132
132
|
files
|
133
133
|
end
|
134
|
-
end
|
134
|
+
end
|
@@ -10,9 +10,11 @@ module Mailgun
|
|
10
10
|
# of communicating with our API.
|
11
11
|
|
12
12
|
class Client
|
13
|
+
attr_reader :api_key
|
13
14
|
|
14
|
-
def initialize(api_key, api_host="api.mailgun.net", api_version="
|
15
|
+
def initialize(api_key, api_host="api.mailgun.net", api_version="v3", ssl=true)
|
15
16
|
endpoint = endpoint_generator(api_host, api_version, ssl)
|
17
|
+
@api_key = api_key
|
16
18
|
@http_client = RestClient::Resource.new(endpoint,
|
17
19
|
:user => "api",
|
18
20
|
:password => api_key,
|
@@ -36,6 +38,21 @@ module Mailgun
|
|
36
38
|
log.error Howitzer::CommunicationError, e.message
|
37
39
|
end
|
38
40
|
|
41
|
+
def get_url(url, params=nil, accept="*/*")
|
42
|
+
response = ::RestClient::Request.execute(
|
43
|
+
method: :get,
|
44
|
+
url: url,
|
45
|
+
user: 'api',
|
46
|
+
password: api_key,
|
47
|
+
user_agent: 'mailgun-sdk-ruby',
|
48
|
+
accept: accept,
|
49
|
+
params: params
|
50
|
+
)
|
51
|
+
Response.new(response)
|
52
|
+
rescue => e
|
53
|
+
log.error Howitzer::CommunicationError, e.message
|
54
|
+
end
|
55
|
+
|
39
56
|
private
|
40
57
|
|
41
58
|
def endpoint_generator(api_host, api_version, ssl)
|
data/lib/howitzer/version.rb
CHANGED
@@ -174,19 +174,6 @@ RSpec.describe 'Capybara::Settings' do
|
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
177
|
-
context "and opera browser" do
|
178
|
-
before do
|
179
|
-
allow(Capybara::Settings).to receive(:ie_browser?).and_return(false)
|
180
|
-
allow(Capybara::Settings).to receive(:ff_browser?).and_return(false)
|
181
|
-
allow(Capybara::Settings).to receive(:chrome_browser?).and_return(false)
|
182
|
-
allow(Capybara::Settings).to receive(:opera_browser?).and_return(true)
|
183
|
-
end
|
184
|
-
it do
|
185
|
-
expect(subject.call).to be_an_instance_of(Capybara::Selenium::Driver)
|
186
|
-
expect(subject.call.options[:desired_capabilities][:browser_name]).to eq('opera')
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
177
|
context "and safari browser" do
|
191
178
|
before do
|
192
179
|
allow(Capybara::Settings).to receive(:ie_browser?).and_return(false)
|
@@ -451,4 +438,4 @@ RSpec.describe 'Capybara::Settings' do
|
|
451
438
|
it { is_expected.to eq('') }
|
452
439
|
end
|
453
440
|
end
|
454
|
-
end
|
441
|
+
end
|
data/spec/unit/lib/email_spec.rb
CHANGED
@@ -44,10 +44,23 @@ RSpec.describe 'Email' do
|
|
44
44
|
let(:events) { double(to_h: {'items' => [event]}) }
|
45
45
|
subject { Email.find(recipient, message_subject) }
|
46
46
|
context 'when message is found' do
|
47
|
-
let(:
|
47
|
+
let(:url) { 'https://mailgun.com/domains/mailgun@test.domain/messages/1234567890' }
|
48
|
+
let(:event) do
|
49
|
+
{
|
50
|
+
'message' => {
|
51
|
+
'recipients' => [recipient],
|
52
|
+
'headers' => {
|
53
|
+
'subject' => message_subject
|
54
|
+
}
|
55
|
+
},
|
56
|
+
'storage' => {
|
57
|
+
'url' => url
|
58
|
+
}
|
59
|
+
}
|
60
|
+
end
|
48
61
|
before do
|
49
62
|
allow(Mailgun::Connector.instance.client).to receive(:get).with('mailgun@test.domain/events', event: 'stored').ordered.once {events}
|
50
|
-
allow(Mailgun::Connector.instance.client).to receive(:
|
63
|
+
allow(Mailgun::Connector.instance.client).to receive(:get_url).with(url).ordered.once { mailgun_message }
|
51
64
|
end
|
52
65
|
it do
|
53
66
|
expect(Email).to receive(:new).with(message).once
|
@@ -126,4 +139,4 @@ RSpec.describe 'Email' do
|
|
126
139
|
end
|
127
140
|
end
|
128
141
|
end
|
129
|
-
end
|
142
|
+
end
|
@@ -19,11 +19,10 @@ RSpec.describe Mailgun::Response do
|
|
19
19
|
it { is_expected.to eq({'foo' => 'bar'})}
|
20
20
|
end
|
21
21
|
context 'when impossible parse body' do
|
22
|
-
let(:body) {
|
22
|
+
let(:body) { "123" }
|
23
23
|
it do
|
24
|
-
expect(log).to receive(:error).with(Howitzer::ParseError, "757: unexpected token at '123'").once.and_call_original
|
25
24
|
expect { subject }.to raise_error(Howitzer::ParseError)
|
26
25
|
end
|
27
26
|
end
|
28
27
|
end
|
29
|
-
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: howitzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Parashchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tins
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.6.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.6.0
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rake
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,16 +168,16 @@ dependencies:
|
|
140
168
|
name: rest-client
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
|
-
- - "
|
171
|
+
- - "~>"
|
144
172
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
173
|
+
version: '1.8'
|
146
174
|
type: :runtime
|
147
175
|
prerelease: false
|
148
176
|
version_requirements: !ruby/object:Gem::Requirement
|
149
177
|
requirements:
|
150
|
-
- - "
|
178
|
+
- - "~>"
|
151
179
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
180
|
+
version: '1.8'
|
153
181
|
- !ruby/object:Gem::Dependency
|
154
182
|
name: poltergeist
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -425,7 +453,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
425
453
|
version: '0'
|
426
454
|
requirements: []
|
427
455
|
rubyforge_project:
|
428
|
-
rubygems_version: 2.
|
456
|
+
rubygems_version: 2.6.6
|
429
457
|
signing_key:
|
430
458
|
specification_version: 4
|
431
459
|
summary: Ruby based framework for acceptance testing
|
@@ -470,4 +498,3 @@ test_files:
|
|
470
498
|
- spec/unit/lib/utils/page_validator_spec.rb
|
471
499
|
- spec/unit/lib/web_page_spec.rb
|
472
500
|
- spec/unit/version_spec.rb
|
473
|
-
has_rdoc:
|