Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

undefined method `click' for class `Capybara::Driver::RackTest::Node' (NameError) #130

Merged
merged 1 commit into from May 9, 2011

Conversation

Projects
None yet
5 participants
Contributor

fd commented Apr 26, 2011

No description provided.

Great, thanks! I was already looking at that file and the capybara rdoc and noticed the differences, but was unsure if I could simply change it. Thanks again.

Contributor

fd commented Apr 26, 2011

no problem!

Did you also happen to get a "cannot start a transaction within a transaction (SQLite3::SQLException)" error when updating? Just asking, if not I'll be off to search the interwebs, I figure it's related to my spec_helper.rb, but it worked before the upgrade, so it's kind of weird.

  config.use_transactional_fixtures = false

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    if example.metadata[:js]
      DatabaseCleaner.strategy = :truncation
    else
      DatabaseCleaner.start
    end
  end

  config.after(:each) do
    DatabaseCleaner.clean
    if example.metadata[:js]
      DatabaseCleaner.strategy = :transaction
    end
  end
Contributor

fd commented Apr 26, 2011

Yes, I've had a similar problem. Basically both Rails and DatabaseCleaner try to start a transaction which results in a dead-lock. I solved this by just always using :truncation.

Thanks, that solved the issue, this was the exact line causing the problems:

DatabaseCleaner.strategy = (ENV["SELENIUM"] == "true") ? :truncation : :transaction

Though I wonder if selenium steps will still work as expected (I don't have any yet, but will be writing them soon)

rounders commented May 3, 2011

thanks fd, your fix worked for me as well.

Owner

aslakhellesoy commented May 4, 2011

As much as I'd love to apply this pull request - I can't, as there are no tests to demonstrate what isn't working. It's only with tests (features) that I can maintain cucumber-rails so that it doesn't break in the future.

When I have a feature that fails without this fix (and passes with it) I'll apply it and make it part of the next release.

Contributor

fd commented May 4, 2011

Well, If you're not seeing any failing test it must be because eather you're not using (the right version of) capybara or you don't have any tests testing the capybara functionality. This patch is needed to support the new capybara Driver API.

Owner

aslakhellesoy commented May 4, 2011

I'm using Capybara 0.4.1.2. You're right that I don't have any features for the existing functionality (my bad). Any chance you could add one, or at least remind me how to create a link that uses javascript in Rails? (I haven't used it for a while and don't remember off the top of my head how)

Owner

aslakhellesoy commented May 9, 2011

Fixed

@aslakhellesoy aslakhellesoy merged commit 64c254b into cucumber:master May 9, 2011

Vanuan commented May 16, 2012

Any chance to backport this for cucumber-rails 0.3.x?

Owner

aslakhellesoy commented May 16, 2012

@Vanuan I'd accept a pull request if that's what you mean. You should branch off from tag corresponding to the version you want to branch off from.

Vanuan commented May 16, 2012

Apparently, this patch is not enough to support the newest capybara for cucumber-rails 0.3.2. I'll submit a pull request if I'll be able to fix all errors caused by capybara_javascript_emulation.rb.

Vanuan commented May 16, 2012

Done: #213
Please, release it on rubygems if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment