Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Explicit message testing. Why failing?
- Loading branch information
Showing
1 changed file
with
21 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |