Commit 2694ba7807080fccc61408c7fc21b22506d417e2

Created our Posts controller and specified a single #index action.

Commit diff

app/controllers/posts.rb

 
1class Posts < Application
2
3 def index
4 render
5 end
6
7end
toggle raw diff

app/helpers/posts_helper.rb

 
1module Merb
2 module PostsHelper
3
4 end
5end
toggle raw diff

app/views/posts/index.html.erb

 
1You're in index of the Posts
toggle raw diff

log/merb_test.log

 
3333 ~ SQL (0.000333) SET NAMES 'utf8'
3434 ~ SQL (0.000126) SET SQL_AUTO_IS_NULL=0
3535 ~ Post Columns (0.002168) SHOW FIELDS FROM `posts`
36 ~ Loaded TEST Environment...
37 ~ loading gem 'merb_activerecord' from ...
38 ~ loading gem 'merb_helpers' from ...
39 ~ loading gem 'activerecord' from ...
40 ~ Connecting to database...
41 ~ Compiling routes...
42 ~ Using 'share-nothing' cookie sessions (4kb limit per client)
43 ~ {:action_time=>0.023912, :before_filters_time=>1.6e-05, :after_filters_time=>9.0e-06}
toggle raw diff

spec/controllers/posts_spec.rb

 
1require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
2
3describe Posts, "#index" do
4
5 it "should respond correctly" do
6 dispatch_to( Posts, :index ).should respond_successfully
7 end
8
9end
toggle raw diff

spec/helpers/posts_helper_spec.rb

 
1require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
2
3describe Merb::PostsHelper do
4
5end
toggle raw diff