Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4 compatibility #231

Closed
joallard opened this issue Jan 6, 2013 · 25 comments
Closed

Rails 4 compatibility #231

joallard opened this issue Jan 6, 2013 · 25 comments

Comments

@joallard
Copy link

joallard commented Jan 6, 2013

For Rails 4 preparedness, I got the following under Rails 4.0.0.beta

ActionController::Integration is deprecated

DEPRECATION WARNING: ActionController::Integration is deprecated and will be removed, use ActionDispatch::Integration instead. (called from module:Rails at .../1.9.3-p0/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails/world.rb:9)

This comes up once at the start, when firing cucumber.

#increment_open_transactions

DEPRECATION WARNING: #increment_open_transactions is deprecated and has no effect. (called from increment_open_transactions at /home/jon/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bundler/gems/rails-aebd40efc711/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:258)

This comes up on each scenario each time there is a DB operation, I think.

@pahnin
Copy link

pahnin commented Jan 17, 2013

I guess this deprecation is reason for the following problem http://stackoverflow.com/questions/14367396/sql-error-cannot-start-a-transaction-within-a-transaction-while-testing-with-cuc
I can't create a record through cucumber, but I can do it manually with browser..

@mattwynne
Copy link
Member

I haven't had time to look at Rails 4 yet. Anyone blessed with more time would like to look at this and get a PR together?

@bruz
Copy link

bruz commented Feb 11, 2013

This pull request covers the ActionController::Integration deprecation: #234

@dbruns
Copy link
Contributor

dbruns commented Feb 11, 2013

For what its worth, in my playing with rails 4 for the last few weeks, I've not run into any other issues.

@andriytyurnikov
Copy link

@dbruns fixtures work out of the box?

@aslakhellesoy
Copy link
Contributor

Rails 4 compatibility means all of cucumber-rails' features/specs pass. We should create a rails-4.0 branch for this that also contains other changes made on master (merge/rebase with master regularly).

The build system should also be modified so that all features/specs can be run against both Rails 3.x and 4.x, by changing e.g. an environment variable.

@mattwynne
Copy link
Member

The build system should also be modified so that all features/specs can be run against both Rails 3.x and 4.x, by changing e.g. an environment variable

Yes, I was thinking about this. We should use a build matrix:
http://about.travis-ci.org/docs/user/build-configuration/#The-Build-Matrix

@joallard
Copy link
Author

joallard commented Apr 1, 2013

Then I'm guessing a Gemfile for Rails 4 should be added?

@Kosmas
Copy link
Member

Kosmas commented Apr 2, 2013

Yes by using the appraisal gem as discussed here #240

@joallard
Copy link
Author

joallard commented Apr 2, 2013

Ah, so we are dependent on #238.

@joallard
Copy link
Author

Mongoid now supports Rails 4.0.0.rc2.

@Kosmas
Copy link
Member

Kosmas commented Jun 25, 2013

Which version is that?
Looking at the 3.1.4 version on rubygems it has activemodel ~> 3.2 as dependency?

@aslakhellesoy
Copy link
Contributor

Looks like it's not released yet, only in git. Could you try using a git URL for the dependency?

http://gembundler.com/v1.3/git.html

@Kosmas
Copy link
Member

Kosmas commented Jun 25, 2013

I've tried using

gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'

in the appraisal for rails 4 but I don't think it works.

@aslakhellesoy
Copy link
Contributor

@Kosmas what's the error message?

@Kosmas
Copy link
Member

Kosmas commented Jun 25, 2013

@aslakhellesoy https://gist.github.com/Kosmas/5862807

when I use the link into the mongoid feature even the rails_3 branch fails

@jaimeohm
Copy link

I get those warnings, too, when running cucumber or rake cucumber on Rails 4.0.0.

.../.rvm/rubies/ruby-2.0.0-p247/bin/ruby -S bundle exec cucumber  --profile default
DEPRECATION WARNING: ActionController::Integration is deprecated and will be removed, use ActionDispatch::Integration instead. (called from require at .../features/support/env.rb:7)
DEPRECATION WARNING: ActionController::IntegrationTest is deprecated and will be removed, use ActionDispatch::IntegrationTest instead. (called from require at .../features/support/env.rb:7)

@drewdeponte
Copy link

I am using ruby-2.0.0-p247 and Rails 4.0.0 and I get the following warnings when I run my cucumber tests, as a result of require 'cucumber/rails' in features/support/env.rb.

DEPRECATION WARNING: ActionController::Integration is deprecated and will be removed, use ActionDispatch::Integration instead. (called from require at /Users/adeponte/code/bbsoft
/codebreakdown/features/support/env.rb:7)
DEPRECATION WARNING: ActionController::IntegrationTest is deprecated and will be removed, use ActionDispatch::IntegrationTest instead. (called from require at /Users/adeponte/cod
e/bbsoft/codebreakdown/features/support/env.rb:7)

@marcinczenko
Copy link

I modified the cucumber-rails 1.3.0 gem temporarily as follows: in the file lib/cucumber/rails/rspec.rb I've changed:

# line 7 and line 15
[Cucumber::Rails::World, ActionController::Integration::Session].each do |klass|

to:

[Cucumber::Rails::World, ActionDispatch::Integration::Session].each do |klass|

then in file lib/cucumber/rails/world.rb:

# line 9
class World < ActionController::IntegrationTest #:nodoc:

to:

class World < ActionDispatch::IntegrationTest #:nodoc:

I did not observe any trouble yet, but I did not check the stuff with anything that accesses databases. Is there much more to change? It is 7 months from the first comment in this topic...

@Kosmas
Copy link
Member

Kosmas commented Aug 19, 2013

Here is the latest on the rails 4 compatibility.

https://groups.google.com/forum/?fromgroups=#!topic/cukes-devs/J2xfF6JsIlk

The idea is to make the necessary changes to the tests, so they can all pass in all different versions of rails.

The latest travis with a couple of tests commented out is here:
https://travis-ci.org/cucumber/cucumber-rails

@tilsammans
Copy link

@Kosmas THANK YOU for working on this issue! ❤️

@Kosmas
Copy link
Member

Kosmas commented Aug 22, 2013

@tilsammans thanks.

It should be really close for a new release now, so please test the new version (or current master) and report back here with any issues.

@tilsammans
Copy link

I am using master now, it works without problems.

It might be worthwhile to point out to re-run rails generate cucumber:install after upgrading, but it wasn't a problem to keep the old config.

@Kosmas
Copy link
Member

Kosmas commented Aug 22, 2013

@tilsammans thanks for letting me know.

I've added the suggestion to rerun the installation script on the README file.
Thanks for pointing this out!

@Kosmas
Copy link
Member

Kosmas commented Aug 23, 2013

version 1.4.0 is rails 4 compatible now.

@Kosmas Kosmas closed this as completed Aug 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests