ruby on rails - spec/helpers/application_helper_spec.rb cannot pass: undefined method `load_session' for nil:NilClass -
i'm rails newbie, , following michael hartl's rails tutorial. i'm having trouble getting rspec past in 5th chapter. here troublesome spec/helpers/application_helper_spec.rb:
require 'spec_helper' describe applicationhelper describe "full_title" "should include page title" full_title("foo").should =~ /foo/ end end end
and bin/rspec spec/helpers/application_helper_spec.rb gives:
failure/error: unable find matching line backtrace nomethoderror: undefined method `load_session' nil:nilclass
i have applicationhelper defined in app/helper/application_helper.rb, , test in spec/requests past without problems. idea what's going on? in advance!
and here app/helper/application_helper.rb
module applicationhelper # returns full title on per-page basis. def full_title(page_title) base_title = "ruby on rails tutorial sample app" if page_title.empty? base_title else "#{base_title} | #{page_title}" end end end
in case want it, here's spec/spec_helper.rb: http://dpaste.com/1309484/
and version of gems: http://dpaste.com/hold/1309485/
edited
well, figured spork problem, i'm not sure, cause if replace require "spec_helper" line this:
require "/home/charlie/rails_projects/sample_app/app/helpers/application_helper.rb" rspec.configure |c| c.include applicationhelper end
the test pasts. , spec_helper set spork. there wrong spec_helper.rb?
it seems can solved updating guard-spork 1.4.2, ,
bundle install
Comments
Post a Comment