Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Justin Palmer
committed
Jan 22, 2009
1 parent
db945eb
commit a66fc04
Showing
3 changed files
with
49 additions
and
18 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
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 |
---|---|---|
@@ -1,11 +1,33 @@ | ||
require 'spec/spec_helper' | ||
include Sunshine | ||
|
||
describe Lobbyist do | ||
before do | ||
#@lobbyists.search('Sunlight Foundation') | ||
@lobbyists = Lobbyist.search('William Corr') | ||
end | ||
|
||
it "should exclude firstname and lastname from instance" do | ||
@speaker.class.keys_to_exclude.should be(['firstname', 'lastname']) | ||
it "should find lobbyists" do | ||
score = @lobbyists.first[0] | ||
lobbyist = @lobbyists.first[1] | ||
|
||
score.should == 1.0 | ||
lobbyist.should be_instance_of(Lobbyist) | ||
end | ||
|
||
it "should lazily load filings" do | ||
lobbyist = @lobbyists.first[1] | ||
|
||
filing_var = lobbyist.send(:instance_variable_get, "@filings") | ||
filing_var.should be(nil) | ||
|
||
filings = lobbyist.filings | ||
filings.first.should be_instance_of(DisclosureFiling) | ||
|
||
filing_var = lobbyist.send(:instance_variable_get, "@filings") | ||
filing_var.should_not == nil | ||
end | ||
|
||
it "should exclude keys from instance" do | ||
Lobbyist.keys_to_exclude.should == [:firstname, :lastname, :filings] | ||
end | ||
end |