Commit 4ef4564d

mo khan <mo@mokhan.ca>
2014-06-02 02:54:27
specify default url options for when using url helpers to publish a tweet.
1 parent be8e2f8
Changed files (2)
config/routes.rb
@@ -1,4 +1,6 @@
 Cake::Application.routes.draw do
+  default_url_options(Rails.application.config.action_mailer.default_url_options)
+
   get "about_us" => "home#about_us"
   get "why_cakeside" => "home#why_cakeside"
 
spec/services/handlers/publish_cake_to_twitter_spec.rb
@@ -18,7 +18,6 @@ describe PublishCakeToTwitter do
     let(:id) { 88 }
 
     before :each do
-      Rails.application.routes.default_url_options[:host]= 'localhost:3000' 
       cake.stub(:user).and_return(artist)
       cakes.stub(:find).with(id).and_return(cake)
     end
@@ -31,7 +30,7 @@ describe PublishCakeToTwitter do
 
       it "tweets new cakes" do
         subject.handle(cake_id: id)
-        twitter.should have_received(:tweet).with("yummy By joe on http://localhost:3000/creations/88-yummy!")
+        twitter.should have_received(:tweet).with("yummy By joe on http://www.blah.com/creations/88-yummy!")
       end
     end