[rspec-users] Failing Flash Spec

Kwang how Tan lists at ruby-forum.com
Mon May 17 22:32:34 EDT 2010


Here are the failure messages, and the backtraces.

Thx

1) SessionsController #create authenticate fail flash.now[:error] should 
be set to failure
    Failure/Error: flash.now[: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: 
expects(:redirect_to_target_or_default).with(twikets_path)
    not all expectations were satisfied
    unsatisfied expectations:
    - expected exactly once, not yet invoked: 
#<Rspec::Core::ExampleGroup::Nested_1::Nested_2::Nested_2:0xe058520>.redirect_to_target_or_default('/twikets')
    satisfied expectations:
    - allowed any number of times, already invoked once: User(id: 
integer, username: string, name: string, password_hash: string, 
password_salt: string, status: string, lock_version: integer, 
created_at: datetime, updated_at: datetime).authenticate(any_parameters)
    # ./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.47966 seconds
14 examples, 2 failures
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list