fixed the dumb autotest bug. by adding mocha, it seemed to work. also fixed a bug where authenticate is called to warden and a view IZ MS

This commit is contained in:
maxwell 2010-06-14 11:05:55 -07:00
parent 29c6f9fa0f
commit 0ff541ba43
4 changed files with 12 additions and 4 deletions

View file

@ -19,6 +19,7 @@ gem "devise", :git => "git://github.com/plataformatec/devise.git"
gem 'ruby-debug'
group :test do
gem 'rspec', '>= 2.0.0.beta.10'
gem 'rspec-rails', ">= 2.0.0.beta.8"
gem "mocha"
gem 'webrat'

View file

@ -1,6 +1,6 @@
- title "New Status Message"
- form_for @status_message do |f|
= form_for @status_message do |f|
= f.error_messages
%p
= f.label :message

View file

@ -11,11 +11,14 @@ describe StatusMessagesController do
render_views
it "index action should render index template" do
request.env['warden'].should_receive(:authenticate?).at_least(:once)
get :index
response.should render_template(:index)
end
it "create action should render new template when model is invalid" do
request.env['warden'].should_receive(:authenticate?).at_least(:once)
StatusMessage.any_instance.stubs(:valid?).returns(false)
post :create
response.should render_template(:new)
@ -28,6 +31,8 @@ describe StatusMessagesController do
end
it "new action should render new template" do
request.env['warden'].should_receive(:authenticate?).at_least(:once)
get :new
response.should render_template(:new)
end
@ -40,6 +45,8 @@ describe StatusMessagesController do
end
it "show action should render show template" do
request.env['warden'].should_receive(:authenticate?).at_least(:once)
get :show, :id => StatusMessage.first.id
response.should render_template(:show)
end

View file

@ -12,8 +12,8 @@ Rspec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
#this is a dumb hax TODO
config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec