[rspec-users] Failing Flash Spec

Kwang how Tan lists at ruby-forum.com
Tue May 18 00:52:11 EDT 2010


Both Spec still fail :(

1) SessionsController #create authenticate fail flash.now[:error] should 
be set to failure
    Failure/Error: flash[:error].should == "Invalid username or 
password!"
    expected: "Invalid username or password!",
         got: nil (using ==)
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-expectations-2.0.0.beta.8/lib/rspec/expectations/fail_with.rb:23:in 
`fail_with'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-expectations-2.0.0.beta.8/lib/rspec/matchers/operator_matcher.rb:39:in 
`fail_with_message'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-expectations-2.0.0.beta.8/lib/rspec/matchers/operator_matcher.rb:61:in 
`__delegate_operator'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-expectations-2.0.0.beta.8/lib/rspec/matchers/operator_matcher.rb:51:in 
`eval_match'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-expectations-2.0.0.beta.8/lib/rspec/matchers/operator_matcher.rb:29:in 
`block in use_custom_matcher_or_delegate'
    # ./spec/controllers/sessions_spec.rb:33:in `block (4 levels) in 
<top (required)>'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:41:in 
`instance_eval'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:41:in 
`block in run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:39:in 
`catch'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:39:in 
`run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:181:in 
`block in run_examples'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:179:in 
`map'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:179:in 
`run_examples'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:171:in 
`run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`block in run_all'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`each'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`inject'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`run_all'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:27:in 
`block in run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/formatters/base_formatter.rb:34:in 
`block in report'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/formatters/base_formatter.rb:140:in 
`sync_output'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/formatters/base_formatter.rb:29:in 
`report'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:26:in 
`run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:12:in 
`block in autorun'

2) SessionsController #create authenticate successfully should redirect
    Failure/Error: 
controller.expects(:redirect_to_target_or_default).with(twikets_path)
    undefined local variable or method `controller' for 
#<Rspec::Core::ExampleGroup::Nested_1::Nested_2::Nested_2:0xc256ef4>
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-expectations-2.0.0.beta.8/lib/rspec/matchers/method_missing.rb:6:in 
`method_missing'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/testing/assertions/routing.rb:174:in 
`method_missing'
    # ./spec/controllers/sessions_spec.rb:44:in `block (4 levels) in 
<top (required)>'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:41:in 
`instance_eval'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:41:in 
`block in run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:39:in 
`catch'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example.rb:39:in 
`run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:181:in 
`block in run_examples'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:179:in 
`map'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:179:in 
`run_examples'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/example_group.rb:171:in 
`run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`block in run_all'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`each'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`inject'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:51:in 
`run_all'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:27:in 
`block in run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/formatters/base_formatter.rb:34:in 
`block in report'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/formatters/base_formatter.rb:140:in 
`sync_output'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/formatters/base_formatter.rb:29:in 
`report'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:26:in 
`run'
    # 
/home/tkhow/.rvm/gems/ruby-1.9.1-p378/gems/rspec-core-2.0.0.beta.8/lib/rspec/core/runner.rb:12:in 
`block in autorun'


Finished in 0.40236 seconds
14 examples, 2 failures

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list