Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adicionado a variável @article

  • Loading branch information...
commit 4cab19450d4a527556589e9a2f34278a46a4b9ba 1 parent d4f1c4b
@rafaelfranca authored
View
1  app/controllers/articles_controller.rb
@@ -4,5 +4,6 @@ def index
end
def new
+ @article = Article.new
end
end
View
8 spec/controllers/articles_controller_spec.rb
@@ -8,7 +8,7 @@
end
it "deveria setar @articles" do
- get 'index'
+ act!
assigns['articles'].should == @articles
end
@@ -32,4 +32,10 @@ def act!
end
end
+ describe "GET 'new'" do
+ it "deveria setar @article" do
+ get 'new'
+ assigns['article'].should be_new_record
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.