Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Spec for redirect testing

  • Loading branch information...
commit 4cb39f8f93cf6940d83528f68e796cd19542f277 1 parent 4f051e2
Ludo van den Boom authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 spec/controllers/messages_controller_spec.rb
11 spec/controllers/messages_controller_spec.rb
View
@@ -30,11 +30,16 @@
describe "POST /messages" do
it "should initialize a new message from params" do
- Message.should_receive(:new).with(:body => "Something interesting")
- post :create, :body => "Something interesting"
+ attrs = { "body" => "Something interesting" }
+ Message.should_receive(:new).with(attrs)
+ post :create, message: attrs
end
it "should save the message"
- it "should redirect to shared messages list"
+
+ it "should redirect to shared messages list" do
+ post :create
+ response.should redirect_to(messages_path)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.