igmarin
2/27/2014 - 10:58 PM

messages error

messages error

➜  techscenemx git:(task-49) ✗ rspec spec/controllers/messages_controller_spec.rb     

MessagesController
  GET index
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
    assigns all messages as @messages (FAILED - 1)
  GET show
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
    assigns the requested message as @message (FAILED - 2)
  GET new
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
    assigns a new message as @message
  GET edit
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
    assigns the requested message as @message (FAILED - 3)
  POST create
    with valid params
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      creates a new Message (FAILED - 4)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      assigns a newly created message as @message (FAILED - 5)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      redirects to the created message (FAILED - 6)
    with invalid params
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      assigns a newly created but unsaved message as @message (FAILED - 7)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      re-renders the 'new' template (FAILED - 8)
  PUT update
    with valid params
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      updates the requested message (FAILED - 9)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      assigns the requested message as @message (FAILED - 10)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      redirects to the message (FAILED - 11)
    with invalid params
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      assigns the message as @message (FAILED - 12)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
      re-renders the 'edit' template (FAILED - 13)
  DELETE destroy
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
    destroys the requested message (FAILED - 14)
DEPRECATION: stub! is deprecated. Use stub instead. Called from /Users/igmarin/Code/Hybrid/techscenemx/spec/controllers/messages_controller_spec.rb:41:in `block (2 levels) in <top (required)>'.
    redirects to the messages list (FAILED - 15)

Failures:

  1) MessagesController GET index assigns all messages as @messages
     Failure/Error: assigns(:messages).should eq([message])
       
       expected: [#<Message id: 9, user_id: 4, recipients: ["User profile name"], subject: "Hello World!", body: "Lorem ipsum dolor sit amet", schedule: nil, created_at: "2014-02-27 22:55:55", updated_at: "2014-02-27 22:55:55", recipients_select: ["user_8"], recipients_emails: ["email1@example.com"]>]
            got: []
       
       (compared using ==)
       
       Diff:
       @@ -1,2 +1,2 @@
       -[#<Message id: 9, user_id: 4, recipients: ["User profile name"], subject: "Hello World!", body: "Lorem ipsum dolor sit amet", schedule: nil, created_at: "2014-02-27 22:55:55", updated_at: "2014-02-27 22:55:55", recipients_select: ["user_8"], recipients_emails: ["email1@example.com"]>]
       +[]
       
     # ./spec/controllers/messages_controller_spec.rb:52:in `block (3 levels) in <top (required)>'

  2) MessagesController GET show assigns the requested message as @message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_2:0x007fe384f849d0>
     # ./spec/controllers/messages_controller_spec.rb:58:in `block (3 levels) in <top (required)>'

  3) MessagesController GET edit assigns the requested message as @message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_4:0x007fe38bb2db28>
     # ./spec/controllers/messages_controller_spec.rb:73:in `block (3 levels) in <top (required)>'

  4) MessagesController POST create with valid params creates a new Message
     Failure/Error: post :create, {:message => valid_attributes}, valid_session
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_5::Nested_1:0x007fe38bbb9330>
     # ./spec/controllers/messages_controller_spec.rb:83:in `block (5 levels) in <top (required)>'
     # ./spec/controllers/messages_controller_spec.rb:82:in `block (4 levels) in <top (required)>'

  5) MessagesController POST create with valid params assigns a newly created message as @message
     Failure/Error: post :create, {:message => valid_attributes}, valid_session
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_5::Nested_1:0x007fe38bc60ba8>
     # ./spec/controllers/messages_controller_spec.rb:88:in `block (4 levels) in <top (required)>'

  6) MessagesController POST create with valid params redirects to the created message
     Failure/Error: post :create, {:message => valid_attributes}, valid_session
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_5::Nested_1:0x007fe3879e6278>
     # ./spec/controllers/messages_controller_spec.rb:94:in `block (4 levels) in <top (required)>'

  7) MessagesController POST create with invalid params assigns a newly created but unsaved message as @message
     Failure/Error: post :create, {:message => { "user" => "invalid value" }}, valid_session
     ActiveModel::MassAssignmentSecurity::Error:
       Can't mass-assign protected attributes: user
     # ./spec/controllers/messages_controller_spec.rb:103:in `block (4 levels) in <top (required)>'

  8) MessagesController POST create with invalid params re-renders the 'new' template
     Failure/Error: post :create, {:message => { "user" => "invalid value" }}, valid_session
     ActiveModel::MassAssignmentSecurity::Error:
       Can't mass-assign protected attributes: user
     # ./spec/controllers/messages_controller_spec.rb:110:in `block (4 levels) in <top (required)>'

  9) MessagesController PUT update with valid params updates the requested message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_6::Nested_1:0x007fe38cae9508>
     # ./spec/controllers/messages_controller_spec.rb:119:in `block (4 levels) in <top (required)>'

  10) MessagesController PUT update with valid params assigns the requested message as @message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_6::Nested_1:0x007fe38cb729c0>
     # ./spec/controllers/messages_controller_spec.rb:129:in `block (4 levels) in <top (required)>'

  11) MessagesController PUT update with valid params redirects to the message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_6::Nested_1:0x007fe38cbfbf90>
     # ./spec/controllers/messages_controller_spec.rb:135:in `block (4 levels) in <top (required)>'

  12) MessagesController PUT update with invalid params assigns the message as @message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_6::Nested_2:0x007fe38cc79008>
     # ./spec/controllers/messages_controller_spec.rb:143:in `block (4 levels) in <top (required)>'

  13) MessagesController PUT update with invalid params re-renders the 'edit' template
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_6::Nested_2:0x007fe38cd024e8>
     # ./spec/controllers/messages_controller_spec.rb:151:in `block (4 levels) in <top (required)>'

  14) MessagesController DELETE destroy destroys the requested message
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_7:0x007fe38cd8b360>
     # ./spec/controllers/messages_controller_spec.rb:162:in `block (3 levels) in <top (required)>'

  15) MessagesController DELETE destroy redirects to the messages list
     Failure/Error: message = Message.create! valid_attributes
     NameError:
       undefined local variable or method `valid_attributes' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_7:0x007fe38ce08a40>
     # ./spec/controllers/messages_controller_spec.rb:169:in `block (3 levels) in <top (required)>'

Finished in 0.6349 seconds
16 examples, 15 failures

Failed examples:

rspec ./spec/controllers/messages_controller_spec.rb:49 # MessagesController GET index assigns all messages as @messages
rspec ./spec/controllers/messages_controller_spec.rb:57 # MessagesController GET show assigns the requested message as @message
rspec ./spec/controllers/messages_controller_spec.rb:72 # MessagesController GET edit assigns the requested message as @message
rspec ./spec/controllers/messages_controller_spec.rb:81 # MessagesController POST create with valid params creates a new Message
rspec ./spec/controllers/messages_controller_spec.rb:87 # MessagesController POST create with valid params assigns a newly created message as @message
rspec ./spec/controllers/messages_controller_spec.rb:93 # MessagesController POST create with valid params redirects to the created message
rspec ./spec/controllers/messages_controller_spec.rb:100 # MessagesController POST create with invalid params assigns a newly created but unsaved message as @message
rspec ./spec/controllers/messages_controller_spec.rb:107 # MessagesController POST create with invalid params re-renders the 'new' template
rspec ./spec/controllers/messages_controller_spec.rb:118 # MessagesController PUT update with valid params updates the requested message
rspec ./spec/controllers/messages_controller_spec.rb:128 # MessagesController PUT update with valid params assigns the requested message as @message
rspec ./spec/controllers/messages_controller_spec.rb:134 # MessagesController PUT update with valid params redirects to the message
rspec ./spec/controllers/messages_controller_spec.rb:142 # MessagesController PUT update with invalid params assigns the message as @message
rspec ./spec/controllers/messages_controller_spec.rb:150 # MessagesController PUT update with invalid params re-renders the 'edit' template
rspec ./spec/controllers/messages_controller_spec.rb:161 # MessagesController DELETE destroy destroys the requested message
rspec ./spec/controllers/messages_controller_spec.rb:168 # MessagesController DELETE destroy redirects to the messages list