title: Cucumber + Capybara + Selenium firefox opens example.com not my app
body: <p>I've been using cucumber + webrat but needed extra Rails 3 compatability and javascript testing so changed to capybara + selenium. Currently I'm on Rails 3.0.7, Cucumber 0.10.2, caybara 1.0.0.beta1.</p>
  
  <p>Problem: When I run a javascript scenario firefox opens "http://www.iana.org/domains/example/" or "www.example.com" instead of my rails app.</p>
  
  <p>I'm sure it's just a small setting I'm missing, but I can't find it and this has had me stumped for a couple days now.</p>
  
  <p>Anyway, my gemfile reads:</p>
  
  <pre><code>group :development, :test do
    gem 'cucumber'
    gem 'cucumber-rails', "&gt;= 0.3.2"
    gem 'pickle'
    gem "launchy"
    gem "rspec-rails"
    gem "Selenium"
    gem "selenium-client"
    gem "selenium-webdriver"
    gem "database_cleaner"
    gem "factory_girl_rails"
    gem "capybara"
    gem "escape_utils"
  end
  </code></pre>
  
  <p>The feature is:</p>
  
  <pre><code>  @wip
    @javascript
    Scenario: Calculate 1 recipe and be deducted a credit
      Given the following page records
        | name | permalink |
        | home | home      |
      And the following role records
        | name       |
        | SuperAdmin |
        | Admin      |
        | Customer   |
      When  I register "adam" with password "password"
      And I go to the index
      Then I should see "5 credits"
  </code></pre>
  
  <p>The step that opens the firefox window:</p>
  
  <pre><code>    When /^I am logged in as "([^"]*)" with password "([^"]*)"$/ do |username, password|
    unless username.blank?
      visit(root_path)
      fill_in "user_session_username", :with =&gt; username
      fill_in "user_session_password", :with =&gt; password
      click_button "login"
      page.should have_content("Successfully logged in!")
    end
  end
  </code></pre>
  
  <p>my features/support/env.rb:</p>
  
  <pre><code>   require 'cucumber/rails'
      require 'factory_girl'
      require 'ruby-debug'
      require 'selenium/client'
      # require 'capybara/cucumber' commented out because it doesn't want to work with it in
      Capybara.default_driver = :selenium
  
      Capybara.server_boot_timeout = 50
      Capybara.default_selector = :css
  
      begin
        DatabaseCleaner.strategy = :truncation
      rescue NameError
        raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
      end
  </code></pre>
  
  <p>command prompt says:</p>
  
  <pre><code>    When I register "adam" with password "password"     # features/step_definiti
  ons/web_steps.rb:229
        no link with title, id or text 'register' found (Capybara::ElementNotFound
  )
        (eval):2:in `click_link'
        ./features/step_definitions/web_steps.rb:232:in `/^I register "([^"]*)" wi
  th password "([^"]*)"$/'
        features\credit_behaviour.feature:30:in `When I register "adam" with passw
  ord "password"'
  </code></pre>
  
  <p>I'm fairly new to Rails and to Ruby so be easy on me with any suggestions please, saying that ANY help would be greatly appreciated.</p>