One of my specs fails when I run it via "rake spec" but passes when I use the RSpec executable "spec". The spec fails when I use a url helper in a ActionMailer view. The error message is:
auction_url failed to generate from {:action=>"show", :state=>"asd", :slug=>"asd", :controller=>"auctions"}, expected: {:action=>"show", :controller=>"auctions"}, diff: {:state=>"asd", :slug=>"asd"}
:state and :slug are required attributes for the url, though. The route looks like this:
map.auction ':state/:slug', :controller => 'auctions', :action => 'show'
I set the host, which is needed to use the url helpers in ActionMailer views, in the environment files:
ActionMailer::Base.default_url_options[:host] = 'myhost.com'
What could be the problem? Why is "rake spec" behaving differently from "spec spec"? Anything that is loaded/not loaded when using one or the other?