[HELP] FakeWeb is not working on my RSpec test

113 views
Skip to first unread message

EDEN

unread,
May 13, 2011, 2:51:24 PM5/13/11
to FakeWeb
Hi friends,

I'm new to FakeWeb and I'm trying to write an rspec test with it but
is always connecting to the online url instead of giving me the
registred_uri.

I already added the "FakeWeb.allow_net_connect = false" to the
spec_helper but even so it is always getting the online version,
bellow there is the test that im trying to run:

it "should add feed from meioemensagem" do
url = "http://www.meioemensagem.com.br/home/rss/geral.xml"
file = read_fixture_file("feeds/atartde.ultimasnoticias-
rss.xml") # this is the local file
FakeWeb.register_uri(:any, url, :response => file)

# this method reads the feed and saves it, it is working, but is
not reading the FakeWeb response
feed = Feed.add(url)
feed.should_not be_nil
feed.title.should == "RSS: Notícias Gerais!"
end

Thanks in advance,
Reply all
Reply to author
Forward
0 new messages