Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Spec for redirect testing

  • Loading branch information...
commit 4cb39f8f93cf6940d83528f68e796cd19542f277 1 parent 4f051e2
Ludo van den Boom authored

Showing 1 changed file with 8 additions and 3 deletions. Show diff stats Hide diff stats

  1. +8 3 spec/controllers/messages_controller_spec.rb
11 spec/controllers/messages_controller_spec.rb
@@ -30,11 +30,16 @@
30 30
31 31 describe "POST /messages" do
32 32 it "should initialize a new message from params" do
33   - Message.should_receive(:new).with(:body => "Something interesting")
34   - post :create, :body => "Something interesting"
  33 + attrs = { "body" => "Something interesting" }
  34 + Message.should_receive(:new).with(attrs)
  35 + post :create, message: attrs
35 36 end
36 37
37 38 it "should save the message"
38   - it "should redirect to shared messages list"
  39 +
  40 + it "should redirect to shared messages list" do
  41 + post :create
  42 + response.should redirect_to(messages_path)
  43 + end
39 44 end
40 45 end

0 comments on commit 4cb39f8

Please sign in to comment.
Something went wrong with that request. Please try again.