spec/sappy/monitor_bacon.rb in sappy-0.1.1 vs spec/sappy/monitor_bacon.rb in sappy-0.1.2

- old
+ new

@@ -1,13 +1,16 @@ require File.dirname(__FILE__) + '/../helper' module Sappy describe Monitor do before do - @account = Account.login("valid@email.com", "password") + @account = Account.login(USERNAME, PASSWORD) + end + + before do @account.monitors.each { |m| m.destroy } - @monitor = @account.add_monitor({:name => "New Monitor", :service => "http", :location => "sf", :host => "new-sf-monitor.com", :period => "60"}) + @monitor = @account.add_monitor({:name => "New Monitor", :service => "http", :location => "sf", :host => "engineyard.com", :period => "60"}) end describe "an active monitor" do before do @monitor.enable! @@ -30,13 +33,17 @@ end end describe "a monitor" do it "can be destroyed" do - FakeWeb.register_uri(:get, "https://siteuptime.com/api/rest/?AuthKey=b7kks5mh1l300v5segaksm8gh3&method=siteuptime.monitors", :response => cached_page('monitors_1')) + unless ENV['LIVE_SPECS'] + FakeWeb.register_uri(:get, "https://siteuptime.com/api/rest/?AuthKey=b7kks5mh1l300v5segaksm8gh3&method=siteuptime.monitors", :response => cached_page('monitors_1')) + end @account.monitors.size.should == 1 lambda { @monitor.destroy }.should.not.raise - FakeWeb.register_uri(:get, "https://siteuptime.com/api/rest/?AuthKey=b7kks5mh1l300v5segaksm8gh3&method=siteuptime.monitors", :response => cached_page('monitors')) + unless ENV['LIVE_SPECS'] + FakeWeb.register_uri(:get, "https://siteuptime.com/api/rest/?AuthKey=b7kks5mh1l300v5segaksm8gh3&method=siteuptime.monitors", :response => cached_page('monitors')) + end @account.monitors.size.should == 0 end end end end