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
render_views
#fixtures :all
it 'should, after logging in redirect to the dashboard page' do
pending
#go to /login
#fill in the form
#stub create action
#should get a redirect
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
end
it 'should, after logging in redirect to the dashboard page' do
pending "probs should be in cucumber"
sign_in :user, @user
# request.env['warden'].should_receive(:authenticated?).at_least(:once)
# request.env['warden'].should_receive(:user).at_least(:once)
#User.any_instance.stubs(:valid?).returns(true)
#post :create
end
end

View file

@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../spec_helper'
describe StatusMessage do
it "should have a message" do
it "should have a message" do
n = StatusMessage.new
n.valid?.should be false
n.message = "wales"

View file

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