-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:emailable/emailable-ruby
* 'master' of github.com:emailable/emailable-ruby: Added `mailbox_full?` and `no_reply?` support. Stop tracking Gemfile.lock
- Loading branch information
Showing
4 changed files
with
45 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
Gemfile.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,35 +4,22 @@ class EmailableTest < Minitest::Test | |
|
||
def setup | ||
Emailable.api_key = 'test_7aff7fc0142c65f86a00' | ||
@result ||= Emailable.verify('[email protected]') | ||
sleep(0.25) | ||
end | ||
|
||
def test_verification | ||
refute_nil @result.domain | ||
refute_nil @result.email | ||
refute_nil @result.reason | ||
refute_nil @result.score | ||
refute_nil @result.state | ||
refute_nil @result.user | ||
refute_nil @result.duration | ||
result = Emailable.verify('[email protected]') | ||
refute_nil result.domain | ||
refute_nil result.email | ||
refute_nil result.reason | ||
refute_nil result.score | ||
refute_nil result.state | ||
refute_nil result.user | ||
refute_nil result.duration | ||
end | ||
|
||
def test_verification_state | ||
assert %w(deliverable undeliverable risky unknown).include?(@result.state) | ||
end | ||
|
||
def test_verification_role | ||
result = Emailable.verify('[email protected]') | ||
assert result.role? | ||
refute @result.role? | ||
end | ||
|
||
def test_verification_did_you_mean | ||
result1 = Emailable.verify('[email protected]') | ||
result2 = Emailable.verify('[email protected]') | ||
assert result1.did_you_mean, '[email protected]' | ||
assert_nil result2.did_you_mean | ||
result = Emailable.verify('[email protected]') | ||
assert %w(deliverable undeliverable risky unknown).include?(result.state) | ||
end | ||
|
||
def test_verification_tag | ||
|
@@ -42,7 +29,6 @@ def test_verification_tag | |
|
||
def test_account | ||
account = Emailable.account | ||
|
||
refute_nil account.owner_email | ||
refute_nil account.available_credits | ||
end | ||
|
@@ -62,6 +48,36 @@ def test_name_and_gender | |
end | ||
end | ||
|
||
def test_accept_all? | ||
result = Emailable.verify('[email protected]') | ||
assert result.accept_all? | ||
end | ||
|
||
def test_disposable? | ||
result = Emailable.verify('[email protected]') | ||
assert result.disposable? | ||
end | ||
|
||
def test_free? | ||
result = Emailable.verify('[email protected]') | ||
assert result.free? | ||
end | ||
|
||
def test_role? | ||
result = Emailable.verify('[email protected]') | ||
assert result.role? | ||
end | ||
|
||
def test_mailbox_full? | ||
result = Emailable.verify('[email protected]') | ||
assert result.mailbox_full? | ||
end | ||
|
||
def test_no_reply? | ||
result = Emailable.verify('[email protected]') | ||
assert result.no_reply? | ||
end | ||
|
||
def test_slow_verification | ||
assert_raises(Emailable::TimeoutError) do | ||
Emailable.verify('[email protected]') | ||
|