Permalink
Browse files

Criado o ArticlesController

  • Loading branch information...
1 parent d4db021 commit 0272286866e73aa9af164f93146480fd334df449 @rafaelfranca committed May 9, 2010
@@ -0,0 +1,6 @@
+class ArticlesController < ApplicationController
+ def index
+ @articles = Article.all
+ end
+
+end
@@ -0,0 +1,2 @@
+module ArticlesHelper
+end
@@ -0,0 +1,2 @@
+<h1>Articles#index</h1>
+<p>Find me in app/views/articles/index.html.erb</p>
@@ -0,0 +1,35 @@
+require 'spec_helper'
+
+describe ArticlesController do
+
+ describe "GET 'index'" do
+ before do
+ @articles = [Factory.create(:article), Factory.create(:other_article)]
+ end
+
+ it "deveria setar @articles" do
+ get 'index'
+ assigns['articles'].should == @articles
+ end
+
+ it "deveria renderizar index.html.erb" do
+ act!
+ response.should render_template('index')
+ end
+
+ it "deveria ter sucesso" do
+ act!
+ response.should be_success
+ end
+
+ it "deveria renderizar um html" do
+ act!
+ response.content_type.should == Mime::HTML
+ end
+
+ def act!
+ get 'index'
+ end
+ end
+
+end
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe "articles/index.html.erb" do
+ pending "add some examples to (or delete) #{__FILE__}"
+end

0 comments on commit 0272286

Please sign in to comment.