Giter Club home page Giter Club logo

Comments (15)

negonicrac avatar negonicrac commented on September 27, 2024

Yea!! However, I believe that capybara and webrat are merging so I wouldn't place this as a top priority.

from rspec-rails.

jacquescrocker avatar jacquescrocker commented on September 27, 2024

doesnt look like the merge is happening all that fast. maybe its better to swap over to just swap over to capybara as the default?

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

I'll make it configurable, but webrat will remain the default for now.

from rspec-rails.

justinko avatar justinko commented on September 27, 2024

David are you working on this? If not, I can give it a shot.

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

I'm not. What I'm thinking is that we simply remove the dependency from the gemspec and wrap all the include Webrat::XXX statements in a check for Webrat. Maybe a small helper method so we don't have to say if defined everywhere:

webrat do
  include Webrat::XXX
end

WDYT?

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

Then we can add the same for Capybara, btw.

from rspec-rails.

justinko avatar justinko commented on September 27, 2024

Patch: http://github.com/justinko/rspec-rails/tree/issue-49

Another option would be RSpec::Rails.webrat do ...

But I thought include RSpec::Rails::BrowserSimulators; webrat do ... was cleaner.

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

Hey Justin - that looks good. Do me a favor and either add the includes necessary for Capybara or remove the capybara method and we're good to go (I'd rather not have it 1/2 way there).

from rspec-rails.

justinko avatar justinko commented on September 27, 2024

Capybara includes added: http://github.com/justinko/rspec-rails/tree/issue-49

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

Hey Justin - after merging your branch, when I put capybara in the Gemfile instead of webrat, I get this:

uninitialized constant Capybara::Node::Finders

from rspec-rails.

justinko avatar justinko commented on September 27, 2024

New commit with comments: http://github.com/justinko/rspec-rails/commit/e5e794c4f5b013

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

I merged this to a branch and added some additional changes/info in an another commit:

http://github.com/rspec/rspec-rails/tree/issue-49

As of now there's no way that I can see to get all the capybara expectations to work in view and helper specs. I don't want to merge this to master until that is resolved. I have an email out to Jonas (capybara's author) for some help. In the mean time, feel free to see if you can get it to work without any major surgery. The goal is to be able to use should have_xpath, should have_css, etc, in view and helper specs.

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

I heard back from Jonas and he doesn't think there's a good way to support matchers in view and helper specs right now. This might get resolved in the near-ish future, but for now I'm thinking we just don't include capybara in view/helper specs and document that it only works for request/controller specs. WDYT?

from rspec-rails.

justinko avatar justinko commented on September 27, 2024

Given a.) Most developers spec requests/controllers much more often than views/helpers (if at all) and b.) The rise in popularity of Capybara, I think it would be a good idea to go with your suggestion. Feel free to finish out this issue.

from rspec-rails.

dchelimsky avatar dchelimsky commented on September 27, 2024

Fixed: http://github.com/rspec/rspec-rails/commit/d4ff873441cad75e9dd6e7dd1dfccf532bb4febf

from rspec-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.