diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 6805b99d6..c72a3188f 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -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 + diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 87f7455ba..fc1fb164f 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -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" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ee85a915b..3a28cedfd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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.