Note that there are some explanatory texts on larger screens.

plurals
  1. POCapybara get error `block (2 levels) in <top (required)>'
    primarykey
    data
    text
    <p>Spent whole day with the problem.</p> <p>Very simple test. I want to visit main page and check if it has text "Match".</p> <pre><code>require 'spec_helper' describe "Sign in" do it "should sign in with correct data", :js =&gt; true do visit root_path page.should have_content("Match") end end </code></pre> <p>Running rake spec:requests I've got: </p> <pre><code>1) Sign in should sign in with correct data Failure/Error: visit root_path Timeout::Error: Timeout::Error # ./spec/requests/signin_spec.rb:5:in `block (2 levels) in &lt;top (required)&gt;' </code></pre> <p>Can't fix it. It doesn't work with or without spork and guard, and making me crazy :(</p> <p>My environment:</p> <p>Gemfile:</p> <pre><code>group :test, :development do gem 'rspec-rails', '2.7.0' , :branch =&gt; 'rails3' gem 'capybara' gem 'guard' gem 'guard-rspec' gem 'guard-spork' gem 'growl' gem 'launchy' gem 'growl_notify', :require =&gt; false if RUBY_PLATFORM =~/darwin/i gem 'rb-fsevent', :require =&gt; false if RUBY_PLATFORM =~/darwin/i end </code></pre> <p>spec_helper.rb:</p> <pre><code>require 'rubygems' require 'spork' Spork.prefork do ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' # Add this to load Capybara integration: require 'capybara/rspec' require 'capybara/rails' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| # Loading more in this block will cause your tests to run faster. However, # if you change any configuration or code from libraries loaded here, you'll # need to restart spork for it take effect. # == Mock Framework # # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: # # config.mock_with :mocha # config.mock_with :flexmock # config.mock_with :rr config.mock_with :rspec # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = "#{::Rails.root}/spec/fixtures" # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. config.use_transactional_fixtures = false # If true, the base class of anonymous controllers will be inferred # automatically. This will be the default behavior in future versions of # rspec-rails. config.infer_base_class_for_anonymous_controllers = false #config.treat_symbols_as_metadata_keys_with_true_values = true #config.filter_run :focus =&gt; true #config.run_all_when_everything_filtered = true end end Spork.each_run do # This code will be run each time you run your specs. FactoryGirl.reload end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload