spec/gratitude/statistics_spec.rb in gratitude-0.0.12 vs spec/gratitude/statistics_spec.rb in gratitude-0.1.0
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
require "spec_helper"
describe Gratitude::Statistics do
describe "default attributes" do
@@ -15,31 +17,31 @@
describe "json response" do
it "returns the correct keys in the json hash" do
expect(stats.send(:response_body).keys)
.to eq(
- [
- "average_tip",
- "average_tippees",
- "escrow",
- "last_thursday",
- "nach",
- "nactive",
- "ncc",
- "ngivers",
- "noverlap",
- "nreceivers",
- "other_people",
- "pcc",
- "punc",
- "statements",
- "this_thursday",
- "tip_distribution_json",
- "tip_n",
- "total_backed_tips",
- "transfer_volume"
- ]
+ %w(
+ average_tip
+ average_tippees
+ escrow
+ last_thursday
+ nach
+ nactive
+ ncc
+ ngivers
+ noverlap
+ nreceivers
+ other_people
+ pcc
+ punc
+ statements
+ this_thursday
+ tip_distribution_json
+ tip_n
+ total_backed_tips
+ transfer_volume
+ )
)
end
end
describe "#average_tip_amount" do
@@ -181,16 +183,16 @@
expect(stats.statements.first.class).to be(Hash)
end
it "has statement as a key in each hash element" do
stats.statements.each do |statement|
- expect(statement.has_key?("statement")).to be(true)
+ expect(statement.key?("statement")).to be(true)
end
end
it "has username as a key in each hash element" do
stats.statements.each do |statement|
- expect(statement.has_key?("username")).to be(true)
+ expect(statement.key?("username")).to be(true)
end
end
end
describe "#this_thursday" do