Comments (16)
FYI @request.session seems to work, so maybe is just a shortcut missing or something
from rspec-cells.
And it also seems I can't access the named routes. Here's a spec to demonstrate the issues I'm having:
require 'spec_helper'
describe HeaderCell do
it "demonstrates that we have the correct modules included" do
# This passes
self.class.included_modules.should include(RSpec::Rails::CellExampleGroup)
self.class.included_modules.should include(RSpec::Rails::CellExampleGroup::InstanceMethods)
end
it "should have access to named routes via the controller" do
# This passes
controller.help_path.should == '/help'
end
it "should have access to named routes directly from the example" do
# This FAILS with:
# (undefined local variable or method `help_path' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fb137698120>)
help_path.should == '/help'
end
it "should have access to the session variable via the request" do
# This passes
@request.session[:foo] = 'bar'
@request.session[:foo].should == 'bar'
end
it "should have access to the session directly from the example" do
# This FAILS with:
# (undefined local variable or method `session' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fb137666fd0>)
session[:bar] = 'baz'
session[:bar].should == 'baz'
end
end
from rspec-cells.
I just encountered this problem after upgrading rspec-rails from 0.0.5 to 0.1.1 .
Is there a workaround other than prefixing named routes with @request.
?
from rspec-cells.
Bump
from rspec-cells.
Still happens today
Is there a quick fix?
from rspec-cells.
@PikachuEXE Please paste the complete stacktrace.
from rspec-cells.
@apotonick
Here it is:
Failure/Error: session.key?(:js_event_selector).should be_false
NameError:
undefined local variable or method `session' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_2::Nested_1::Nested_3::Nested_1:0x007f8045ad8fa0>
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-expectations-2.14.3/lib/rspec/matchers/method_missing.rb:9:in `method_missing'
# ./spec/cells/post_auth_js_event_cell_spec.rb:33:in `block (6 levels) in <top (required)>'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example.rb:237:in `instance_eval'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example.rb:237:in `instance_eval'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/hooks.rb:21:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/hooks.rb:85:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/hooks.rb:85:in `each'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/hooks.rb:85:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/hooks.rb:446:in `run_hook'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:345:in `run_before_each_hooks'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example.rb:300:in `run_before_each'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example.rb:113:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example.rb:254:in `with_around_each_hooks'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example.rb:111:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:390:in `block in run_examples'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:386:in `map'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:386:in `run_examples'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:371:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `map'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `map'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `map'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `map'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/example_group.rb:372:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/command_line.rb:28:in `map'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/command_line.rb:28:in `block in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/reporter.rb:58:in `report'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/command_line.rb:25:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/runner.rb:77:in `rescue in run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/runner.rb:73:in `run'
# /Users/PikachuEXE/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.5/lib/rspec/core/runner.rb:17:in `block in autorun'
from rspec-cells.
Still an issue with 0.3?
from rspec-cells.
Let me check next week
from rspec-cells.
Can't check since I am unable to upgrade to cells 4 yet
from rspec-cells.
What keeps you from updating? I know the pain, my friend, we just upgraded an app to Rails 3.2 haha.
from rspec-cells.
The app has too many "old" cells
Need to convert them all into concept cells first 😣
we just upgraded an app to Rails 3.2
Holy... world
from rspec-cells.
I have this bug too. I try to sign_in a user if it is logged in with CASino and it tries to edit its account,.
class RegistrationsController < Devise::RegistrationsController
include CASino::SessionsHelper
before_action :ensure_signed_in, only: [:edit]
skip_before_filter :authenticate_scope!, only: [:edit]
def edit
if current_user
Class.new.extend(Devise::Controllers::Helpers).sign_in(:devise_users, DeviseUser.find(current_user.id))
end
super
end
end
Full trace:
devise (3.4.1) lib/devise/controllers/sign_in_out.rb:89:in `expire_data_after_sign_in!'
devise (3.4.1) lib/devise/controllers/sign_in_out.rb:35:in `sign_in'
app/controllers/registrations_controller.rb:9:in `edit'
actionpack (4.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.3) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.3) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'
activesupport (4.2.3) lib/active_support/callbacks.rb:115:in `call'
activesupport (4.2.3) lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'
activesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'
activesupport (4.2.3) lib/active_support/callbacks.rb:503:in `call'
activesupport (4.2.3) lib/active_support/callbacks.rb:88:in `run_callbacks'
actionpack (4.2.3) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.3) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.3) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.3) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.3) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.3) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.3) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.3) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `call'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:45:in `serve'
actionpack (4.2.3) lib/action_dispatch/routing/mapper.rb:49:in `serve'
actionpack (4.2.3) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.3) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.3) lib/action_dispatch/routing/route_set.rb:821:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.3) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.3) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.2.1) lib/web_console/middleware.rb:31:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.3) lib/rails/engine.rb:518:in `call'
railties (4.2.3) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/home/vagrant/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/vagrant/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/vagrant/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
from rspec-cells.
Your breaking spec file would be helpful to see. I have to warn you, though, I don't use Rspec and Devise so it might take a while.
from rspec-cells.
from rspec-cells.
This doesn't seem to be related to cells?
from rspec-cells.
Related Issues (20)
- All spec about `respond_to` failed on `0.1.11` HOT 4
- Update rspec-cells to expect syntax. HOT 10
- Stubbing is broken in 0.1.11 and 0.2.1 using capybara HOT 10
- How to test cell with usage of `url_for`? HOT 20
- Specs in rspec2 are failling HOT 15
- Drop webrat support HOT 2
- Update rspec-cells to work with rails 4.2 HOT 1
- rspec 3 HOT 15
- Missing generator for concept HOT 5
- allow syntax HOT 3
- CellExampleGroup and ExampleGroup HOT 4
- DEPRECATION WARNING specific to named_routes.helpers HOT 2
- /ruby-2.2.0@webomni/gems/rspec-cells-0.3.0/lib/rspec/cells/example_group.rb:49:in `block in <top (required)>': undefined method `capybara=' for Cell::Testing:Module (NoMethodError) HOT 1
- 8fbc9bc breaks Rails (v4.2.1) controller specs HOT 4
- If you use rspec & rspec-rails > 3.3.0 Fixture Error HOT 3
- Updating to master breaks 'rake' on Codeship HOT 1
- Broken link in README
- Gem Load Error is: uninitialized constant Cell::Testing::Uber HOT 1
- NoMethodError when using route helpers HOT 5
- rspec-cells 0.3.6 is broken with ruby <= 2.6 HOT 1
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-cells.