Skip to content

Commit

Permalink
Update rspec syntax to eliminate deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
opti committed Feb 7, 2015
1 parent b6ad15b commit a9b1cc9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions spec/maxmind/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,36 @@

it "converts username to MD5" do
@request.username = 'testuser'
@request.username.should == '5d9c68c6c50ed3d02a2fcf54f63993b6'
expect(@request.username).to eq '5d9c68c6c50ed3d02a2fcf54f63993b6'
end

it "converts password to MD5" do
@request.password = 'testpassword'
@request.password.should == 'e16b2ab8d12314bf4efbd6203906ea6c'
expect(@request.password).to eq 'e16b2ab8d12314bf4efbd6203906ea6c'
end

it "converts email to MD5" do
@request.email = 'test@test.com'
@request.email.should == 'b642b4217b34b1e8d3bd915fc65c4452'
expect(@request.email).to eq 'b642b4217b34b1e8d3bd915fc65c4452'
end

it "does not double convert an md5 username" do
@request.username = 'b642b4217b34b1e8d3bd915fc65c4452'
@request.username.should == 'b642b4217b34b1e8d3bd915fc65c4452'
expect(@request.username).to eq 'b642b4217b34b1e8d3bd915fc65c4452'
end

it "does not double convert an md5 password" do
@request.password = 'b642b4217b34b1e8d3bd915fc65c4452'
@request.password.should == 'b642b4217b34b1e8d3bd915fc65c4452'
expect(@request.password).to eq 'b642b4217b34b1e8d3bd915fc65c4452'
end

it "does not double convert an md5 email" do
@request.email = 'b642b4217b34b1e8d3bd915fc65c4452'
@request.email.should == 'b642b4217b34b1e8d3bd915fc65c4452'
expect(@request.email).to eq 'b642b4217b34b1e8d3bd915fc65c4452'
end

it "exposes the query parameters" do
@request.query.should be_a Hash
expect(@request.query).to be_a Hash
end

end
32 changes: 16 additions & 16 deletions spec/maxmind/response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,59 +22,59 @@
end

it "exposes its attributes" do
@response.attributes.should be_a Hash
expect(@response.attributes).to be_a Hash
end

it "exposes the raw response body" do
@response.body.should == @response_body
expect(@response.body).to eq @response_body
end

it "exposes the http response code" do
@response.http_code.should == 200
expect(@response.http_code).to eq 200
end

it "has a distance" do
@response.distance.should == 329
expect(@response.distance).to eq 329
end

it "has a maxmind ID" do
@response.maxmind_id.should == '9VSOSDE2'
expect(@response.maxmind_id).to eq '9VSOSDE2'
end

it "has a risk score" do
@response.risk_score.should == 2.0
expect(@response.risk_score).to eq 2.0
end

it "has a score" do
@response.score.should == 7.66
expect(@response.score).to eq 7.66
end

it "has queries remaining" do
@response.queries_remaining.should == 955
expect(@response.queries_remaining).to eq 955
end

it "has an explanation" do
@response.explanation.should be_a String
expect(@response.explanation).to be_a String
end

it "has a country match" do
@response.country_match.should_not == nil
expect(@response.country_match).not_to be_nil
end

it "has a boolean country match" do
@response.country_match.should_not == "Yes"
@response.country_match.should == true
expect(@response.country_match).not_to eq "Yes"
expect(@response.country_match).to be_truthy
end

it "has a phone in billing location" do
@response.phone_in_billing_location.should == false
expect(@response.phone_in_billing_location).to be_falsey
end

it "has a phone in billing location ? method" do
@response.phone_in_billing_location?.should == false
expect(@response.phone_in_billing_location?).to be_falsey
end

it "has a high risk email" do
@response.high_risk_email.should == true
expect(@response.high_risk_email).to be_truthy
end
end

0 comments on commit a9b1cc9

Please sign in to comment.