Commit a5bac9a16ae8658297e5229082e1b6728c5dd023
Committed by
Daniela Feitosa
1 parent
f8e94857
Exists in
staging
and in
42 other branches
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 | 79 | end |
| 80 | 80 | |
| 81 | 81 | def self.url_options |
| 82 | - if ENV['RAILS_ENV'] == 'development' | |
| 82 | + case ENV['RAILS_ENV'] | |
| 83 | + when 'development' | |
| 83 | 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 | 90 | end |
| 91 | 91 | |
| 92 | 92 | def self.development_url_options | ... | ... |