Skip to content
Browse files

Explicit message testing. Why failing?

  • Loading branch information...
1 parent ec2be73 commit d7e856137f66b1093f24d5038eec87efa21758ec @ludo committed Jul 25, 2011
Showing with 21 additions and 15 deletions.
  1. +21 −15 spec/controllers/messages_controller_spec.rb
View
36 spec/controllers/messages_controller_spec.rb
@@ -1,23 +1,29 @@
require 'spec_helper'
describe MessagesController do
- it "should have a 'new' action" do
- get :new
- response.should be_success
- end
+ describe "GET /messages/new" do
+ before(:each) do
+ @message = Message.new
+ end
- it "should render the 'new' template" do
- get :new
- response.should render_template("new")
- end
+ it "should have a 'new' action" do
+ get :new
+ response.should be_success
+ end
- it "should initialize a new message" do
- Message.should_receive(:new)
- get :new
- end
+ it "should render the 'new' template" do
+ get :new
+ response.should render_template("new")
+ end
+
+ it "should initialize a new message" do
+ Message.should_receive(:new)
+ get :new
+ end
- it "should expose a new message to the view" do
- get :new
- assigns[:message].should_not be_nil
+ it "should expose a new message to the view" do
+ get :new
+ assigns[:message].should == @message
+ end
end
end

0 comments on commit d7e8561

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