Comments (15)
Yea!! However, I believe that capybara and webrat are merging so I wouldn't place this as a top priority.
from rspec-rails.
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.
I'll make it configurable, but webrat will remain the default for now.
from rspec-rails.
David are you working on this? If not, I can give it a shot.
from rspec-rails.
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.
Then we can add the same for Capybara, btw.
from rspec-rails.
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.
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.
Capybara includes added: http://github.com/justinko/rspec-rails/tree/issue-49
from rspec-rails.
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.
New commit with comments: http://github.com/justinko/rspec-rails/commit/e5e794c4f5b013
from rspec-rails.
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.
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.
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.
Fixed: http://github.com/rspec/rspec-rails/commit/d4ff873441cad75e9dd6e7dd1dfccf532bb4febf
from rspec-rails.
Related Issues (20)
- "expect to receive with" throws error when switching to Rails 7.1 HOT 17
- Rails/RedundantActiveRecordAllMethod false positive HOT 1
- Rails 7.1 upgrade: using deprecated preview_path= HOT 3
- Rails 7.1 raise WrongScopeError on take_failed_screenshot HOT 3
- be_routable not working in controller spec with Rails 7.1 HOT 2
- Wrap examples with Rails executor HOT 2
- Fixtures for namespaced models don't seem to work in rspec-rails 6.1.0 HOT 6
- Even if specify the use of TestUnit, it will be overwritten by Minitest and cannot be used. HOT 6
- stub_template isn't working as expected on latest version HOT 1
- render_template is not working HOT 12
- View example group inserts controller path into lookup_context in the wrong order HOT 2
- :git => "git://github.com/rspec/rspec.git" Not working anymore HOT 3
- rspec describe/context label within loop not woking HOT 5
- Controllers specs don't currently work on the Rails main branch (8.0.0.alpha) HOT 5
- Rack status code name changes breaks HttpStatusMatcher HOT 6
- Railtie inclusion fails but only from RSpec. (undefined method '+' for class 'Date') HOT 9
- Resetting `ActiveSupport::CurrentAttributes` can be inconsistent due to hook ordering HOT 14
- Private Method Conflict Between Helpers Causes Incorrect Method Call HOT 6
- No route matches when I run controller rspec ? HOT 1
- Support for encrypted attributes in fixtures cannot be enabled when using Rails 7.2.0 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspec-rails.