Permalink
Browse files

search_string is mandatory argument to TransparencyData::Entity#search

  • Loading branch information...
1 parent 5b56e90 commit f9b25be40e5b82cb10b1deef938cb3eca0718396 @jpmckinney jpmckinney committed Nov 7, 2012
Showing with 5 additions and 15 deletions.
  1. +1 −1 lib/gov_kit/transparency_data.rb
  2. +4 −14 spec/transparency_data_spec.rb
@@ -82,7 +82,7 @@ def self.find(id)
#
# Example query:
# entities = GovKit::TransparencyData::Entity.search('nancy+pelosi')
- def self.search(search_string = '')
+ def self.search(search_string)
search_for("/entities.json", { :search => search_string } )
end
end
@@ -36,24 +36,14 @@ module GovKit::TransparencyData
@contributions = Contribution.search
end.should_not raise_error
- @contributions.length.should eql(8)
+ @contributions.length.should eql(8) # 1000 unless using FakeWeb
@contributions[0].contributor_city.should eql("ANCHORAGE")
end
end
end
describe Entity do
context "#search" do
- it "should find all entities" do
- lambda do
- @entities = Entity.search
- end.should_not raise_error
-
- @entities.length.should eql(2)
- @entities[0].name.should eql("Nancy Pelosi (D)")
- @entities[1].name.should eql("Nancy Pelosi for Congress")
- end
-
it 'should return an empty list when no elements found' do
lambda do
@entities = Entity.search( "harry pelosi" )
@@ -66,7 +56,7 @@ module GovKit::TransparencyData
@entities = Entity.search( "nancy+pelosi" )
end.should_not raise_error
- @entities.length.should eql(1)
+ @entities.length.should eql(1) # 2 unless using FakeWeb
end
end
end
@@ -78,7 +68,7 @@ module GovKit::TransparencyData
@records = LobbyingRecord.search
end.should_not raise_error
- @records.length.should eql(5)
+ @records.length.should eql(5) # 1000 unless using FakeWeb
@records[0].lobbyists[0].lobbyist_name.should eql('Dunn, Jennifer B')
end
end
@@ -91,7 +81,7 @@ module GovKit::TransparencyData
@records = Grant.search
end.should_not raise_error
- @records.length.should eql(3)
+ @records.length.should eql(3) # 1000 unless using FakeWeb
@records[0].project_description.should eql('NATIONAL FLOOD INSURANCE PROGRAM')
end
end

0 comments on commit f9b25be

Please sign in to comment.