Commit f1c5f4684eaae8153d960ad3e7c2446f5a6851a5

Authored by Daniel Cunha
1 parent 5729cb10

building url appropriately

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
lib/noosfero.rb
@@ -79,14 +79,14 @@ module Noosfero @@ -79,14 +79,14 @@ module Noosfero
79 end 79 end
80 80
81 def self.url_options 81 def self.url_options
82 - if ENV['RAILS_ENV'] == 'development' 82 + case ENV['RAILS_ENV']
  83 + when 'development'
83 development_url_options 84 development_url_options
84 - elsif ENV['RAILS_ENV'] == 'cucumber'  
85 - { :host => Capybara.current_session.driver.rack_server.host,  
86 - :port => Capybara.current_session.driver.rack_server.port }  
87 - else  
88 - {}  
89 - end 85 + when 'cucumber'
  86 + if Capybara.current_driver == :selenium
  87 + { :host => Capybara.current_session.driver.rack_server.host, :port => Capybara.current_session.driver.rack_server.port }
  88 + end
  89 + end || { }
90 end 90 end
91 91
92 def self.development_url_options 92 def self.development_url_options