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

Rspec not including helpers after update #1626

Closed
gajewsky opened this issue May 23, 2016 · 10 comments
Closed

Rspec not including helpers after update #1626

gajewsky opened this issue May 23, 2016 · 10 comments

Comments

@gajewsky
Copy link

Hey, I updated rspec from 3.1.0 to 3.4.0 in my project and after that, I dont have access to helpers methods in views rspecs. Is it possible to include all helpers for all rspec test?

@JonRowe
Copy link
Member

JonRowe commented May 23, 2016

Can you provide more detail? We haven't changed anything specifically related to this.

@gajewsky
Copy link
Author

While running spec I am getting sth like this:
ActionView::Template::Error:undefined method search_fields_for' for #<#Class:0x0000000b6725e0:0x00000007e44e48>`

When I will back to version 3.1.0 everyhing works.

maybe my gemfile is the cause.

group :test do
  gem "ammeter" , "~> 1.1.3" # specs for generators
  gem "capybara", "~> 2.4.4"
  gem "chromedriver-helper", github: "mars/chromedriver-helper", branch: "download-via-bucket-xml"
  gem "ci_reporter_rspec"    # XML output for Jenkins
  gem "ci_reporter_cucumber" # XML output for Jenkins
  gem "cucumber-rails", "~> 1.4.0", require: false
  gem "cucumber-timed_formatter", require: "timed" # Cucumber timings
  gem "database_cleaner", "~> 1.0.1", require: false
  gem "diff_matcher" # rspec hash_matching
  gem "email_spec"
  gem "execjs"

  gem "ffaker" # generate (Fake) data for seeds

  #=======
  # Guard
  #=====
  gem "guard"
  gem "guard-cucumber"
  gem "guard-rspec", require: false

  gem "kopflos", github: "niklas/kopflos" # eliminates browser window during cuke tests
  gem "launchy" # save_and_open_page
  gem "libnotify", require: false
  gem "pickle", git: "git://github.com/tbuehl/pickle.git"
  gem "rb-inotify", require: false
  gem "rb-fsevent", require: false

  #=======
  # RSpec
  #=====
  gem "rspec-rails", "~> 3.4.2"
  gem "rspec-its", "~> 1.1.0"
  gem "rspec-collection_matchers"

  gem "term-ansicolor" # Coloring for ScenarioTodo
  gem "timecop"
  gem "selenium-webdriver"
  gem "simplecov", require: false
  gem "slop" # for option-parsing in CI-script
  gem "zeus", require: false
end

Thank you for interest!

@gajewsky
Copy link
Author

gajewsky commented May 24, 2016

also when I add
include CheckoutHelper to rails_helper.rb
tests are working. But I cant include each helper manually. Is is possible to include them all?

@JonRowe
Copy link
Member

JonRowe commented May 24, 2016

/cc @samphippen

@fables-tales
Copy link
Member

@gajewsky

Thanks for the issue. We need a little more detail to be able to reproduce this.

Could you please provide us with a rails app that we can clone that demonstrates the issue. Specifically it'd be great if

  1. you could rails new an application and commit
  2. make all the changes necessary to reproduce the issue and commit

then, provide us with a description of how to clone your application and reproduce the issue.

Thanks 👍 :)

@niklas
Copy link

niklas commented May 24, 2016

Hey,

I'm a collegue of @gajewsky and have created a sample app where the application helpers are (sometimes) not available in view specs.

https://github.com/niklas/rspec-rails-3.4-helpers-notfound-views-example

The culprit seems to be the ammeter gem. It seems that the require 'rspec/rails in its init.rb causes that behaviour - some way.

@mrageh
Copy link

mrageh commented Jun 1, 2016

@niklas since the problem is ammeter gem, can this issue be closed now?

@fables-tales
Copy link
Member

@JonRowe I feel like we can close this because the cause is ammeter. Do you agree?

@JonRowe
Copy link
Member

JonRowe commented Jun 2, 2016

I think the cause is rails code loading, the trigger is just ammeter...

@fables-tales
Copy link
Member

Closing as duplicate of #1644

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants