moved redirect commitment to cucumber, delivering stories

This commit is contained in:
maxwell 2010-06-14 11:41:15 -07:00
parent 0ff541ba43
commit f6e662a3fa
3 changed files with 20 additions and 9 deletions

View file

@ -7,12 +7,22 @@ describe UsersController do
end end
render_views render_views
#fixtures :all #fixtures :all
end
describe Devise::SessionsController do
before do
#TODO(dan) Mocking Warden; this is a temp fix
request.env['warden'] = mock_model(Warden, :authenticate => @user, :authenticate! => @user)
@user = User.create(:email => "bob@rob.com", :password => "lala")
end
it 'should, after logging in redirect to the dashboard page' do it 'should, after logging in redirect to the dashboard page' do
pending pending "probs should be in cucumber"
#go to /login sign_in :user, @user
#fill in the form # request.env['warden'].should_receive(:authenticated?).at_least(:once)
#stub create action # request.env['warden'].should_receive(:user).at_least(:once)
#should get a redirect
#User.any_instance.stubs(:valid?).returns(true)
#post :create
end end
end end

View file

@ -3,6 +3,7 @@
ENV["RAILS_ENV"] ||= 'test' ENV["RAILS_ENV"] ||= 'test'
require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails) require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails)
require 'rspec/rails' require 'rspec/rails'
include Devise::TestHelpers
# Requires supporting files with custom matchers and macros, etc, # Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories. # in ./support/ and its subdirectories.