jeudi 14 juillet 2016

Rspec: uninitialized constant Devise::Controllers::SignInOut (NameError)

I am getting uninitialized constant Devise::Controllers::SignInOut (NameError) error whenever i try to execute the controller specs. i can start the webbrick server without any issue but getting this error only while executing rspc test cases.

below is the error that i am getting

C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/devise-3.4.1/lib/devise/con
trollers/helpers.rb:6:in `<module:Helpers>': uninitialized constant Devise::Cont
rollers::SignInOut (NameError)
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/devise-3.4.1/l
ib/devise/controllers/helpers.rb:4:in `<module:Controllers>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/devise-3.4.1/l
ib/devise/controllers/helpers.rb:2:in `<module:Devise>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/devise-3.4.1/l
ib/devise/controllers/helpers.rb:1:in `<top (required)>'
        from E:/Onspot-algo-git/onspot_development/lib/devise.rb:260:in `<module
:Devise>'
        from E:/Onspot-algo-git/onspot_development/lib/devise.rb:8:in `<top (req
uired)>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler/runtime.rb:76:in `require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler/runtime.rb:72:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler/runtime.rb:72:in `block in require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler/runtime.rb:61:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler/runtime.rb:61:in `require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.7.12
/lib/bundler.rb:134:in `require'
        from E:/Onspot-algo-git/onspot_development/config/application.rb:20:in `
<top (required)>'
        from E:/Onspot-algo-git/onspot_development/config/environment.rb:2:in `r
equire'
        from E:/Onspot-algo-git/onspot_development/config/environment.rb:2:in `<
top (required)>'
        from E:/Onspot-algo-git/onspot_development/spec/rails_helper.rb:3:in `re
quire'
        from E:/Onspot-algo-git/onspot_development/spec/rails_helper.rb:3:in `<t
op (required)>'
        from E:/Onspot-algo-git/onspot_development/spec/controllers/home_spec.rb
:1:in `require'
        from E:/Onspot-algo-git/onspot_development/spec/controllers/home_spec.rb
:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/configuration.rb:1361:in `load'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/configuration.rb:1359:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/runner.rb:106:in `setup'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/runner.rb:92:in `run'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/runner.rb:78:in `run'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/lib/rspec/core/runner.rb:45:in `invoke'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/rspec-core-3.4
.4/exe/rspec:4:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.0.0/bin/rspec:23:in `load'
        from C:/RailsInstaller/Ruby2.0.0/bin/rspec:23:in `<main>'

below is my home_spec.rb file

require 'rails_helper'
RSpec.describe :HomeController , :type => :controller do
  describe "Get #index" do
    it "should render template index" do
      get :index
      expect(response).to render_template("index")
    end
  end
end

Aucun commentaire:

Enregistrer un commentaire