spec/search_spec.rb in popularity-0.1.1 vs spec/search_spec.rb in popularity-0.2.1
- old
+ new
@@ -7,29 +7,29 @@
subject {
Popularity.search('http://google.com')
}
it "should return correct total" do
- expect(23422351).to equal subject.total
+ expect(23422376).to equal subject.total
end
context "json" do
- let(:json) { subject.to_json }
+ let(:json) { subject.as_json }
- it "should have each url as root json key" do
+ it "should have each url as root json key" do
subject.sources.each do |source|
expect(json[source.to_s]).to_not be_nil
end
end
- it "should have each network as root json key" do
+ it "should have each network as root json key" do
subject.searches.each do |search|
expect(json[search.url.to_s]).to_not be_nil
end
end
- it "should have each total as root json key" do
+ it "should have each total as root json key" do
expect(json["total"]).to_not be_nil
end
end
end
@@ -55,24 +55,24 @@
it "should allow access to individual results" do
expect(subject.facebook.results.size).to eq(2)
end
context "json" do
- let(:json) { subject.to_json }
+ let(:json) { subject.as_json }
- it "should have each url as root json key" do
+ it "should have each url as root json key" do
subject.sources.each do |source|
expect(json[source.to_s]).to_not be_nil
end
end
- it "should have each network as root json key" do
+ it "should have each network as root json key" do
subject.searches.each do |search|
expect(json[search.url.to_s]).to_not be_nil
end
end
- it "should have each total as root json key" do
+ it "should have each total as root json key" do
expect(json["total"]).to_not be_nil
end
end
end
end