Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/criticaljuncture/federal_re…

…gister
  • Loading branch information...
commit 5c08feeb1f2379a502b8c1be0636a401464c59a0 2 parents 262a985 + 7ffb69d
@yonkeltron authored
View
6 spec/agency_spec.rb
@@ -3,7 +3,7 @@
describe FederalRegister::Agency do
describe ".all" do
before(:each) do
- FakeWeb.register_uri(:get, "http://www.federalregister.gov/api/v1/agencies.json", :body => [{},{}].to_json, :content_type =>"text/json")
+ FakeWeb.register_uri(:get, "http://api.federalregister.gov/v1/agencies.json", :body => [{},{}].to_json, :content_type =>"text/json")
end
it "returns Agency objects" do
@@ -21,7 +21,7 @@
describe "attribute loading" do
before(:each) do
- @agency = FederalRegister::Agency.new({'name' => "Commerce Department", 'json_url' => "http://www.federalregister.gov/api/v1/agencies/1.json"})
+ @agency = FederalRegister::Agency.new({'name' => "Commerce Department", 'json_url' => "http://api.federalregister.gov/v1/agencies/1.json"})
end
describe "existing attribute" do
@@ -37,7 +37,7 @@
end
describe "missing attribute" do
- FakeWeb.register_uri(:get, "http://www.federalregister.gov/api/v1/agencies/1.json", :body => {:description => "Lorem ipsum"}.to_json, :content_type =>"text/json")
+ FakeWeb.register_uri(:get, "http://api.federalregister.gov/v1/agencies/1.json", :body => {:description => "Lorem ipsum"}.to_json, :content_type =>"text/json")
it "should lazy-load from the json_url" do
@agency.send(:attributes)['description'].should be_nil
@agency.description.should == "Lorem ipsum"
View
8 spec/article_spec.rb
@@ -6,7 +6,7 @@
document_number = "2010-213"
FakeWeb.register_uri(
:get,
- "http://www.federalregister.gov/api/v1/articles/#{document_number}.json",
+ "http://api.federalregister.gov/v1/articles/#{document_number}.json",
:content_type =>"text/json",
:body => {:title => "Important Notice"}.to_json
)
@@ -18,7 +18,7 @@
document_number = "some-random-document"
FakeWeb.register_uri(
:get,
- "http://www.federalregister.gov/api/v1/articles/#{document_number}.json",
+ "http://api.federalregister.gov/v1/articles/#{document_number}.json",
:content_type =>"text/json",
:status => 404
)
@@ -30,7 +30,7 @@
it "fetches multiple matching documents" do
FakeWeb.register_uri(
:get,
- "http://www.federalregister.gov/api/v1/articles/abc,def.json",
+ "http://api.federalregister.gov/v1/articles/abc,def.json",
:content_type =>"text/json",
:body => {:results => [{:document_number => "abc"}, {:document_number => "def"}]}.to_json
)
@@ -43,7 +43,7 @@
before(:each) do
FakeWeb.register_uri(
:get,
- "http://www.federalregister.gov/api/v1/articles.json?conditions[term]=Fish",
+ "http://api.federalregister.gov/v1/articles.json?conditions[term]=Fish",
:content_type =>"text/json",
:body => {:count => 3}.to_json
)
View
4 spec/result_set_spec.rb
@@ -3,8 +3,8 @@
describe FederalRegister::ResultSet do
describe "#next" do
it "loads the next_page_url" do
- FakeWeb.register_uri(:get, "http://www.federalregister.gov/api/v1/fishes?page=2", :body => {:count => 24}.to_json, :content_type =>"text/json")
- FederalRegister::ResultSet.new({'next_page_url' => 'http://www.federalregister.gov/api/v1/fishes?page=2'}, FederalRegister::Article).next.count.should == 24
+ FakeWeb.register_uri(:get, "http://api.federalregister.gov/v1/fishes?page=2", :body => {:count => 24}.to_json, :content_type =>"text/json")
+ FederalRegister::ResultSet.new({'next_page_url' => 'http://api.federalregister.gov/v1/fishes?page=2'}, FederalRegister::Article).next.count.should == 24
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.