Skip to content
Extraits de code Groupes Projets
publics_controller_spec.rb 757 octets
Newer Older
  • Learn to ignore specific revisions
  • maxwell's avatar
    maxwell a validé
    require File.dirname(__FILE__) + '/../spec_helper'
     
    describe PublicsController do
     render_views
      
      before do
    
    Raphael's avatar
    Raphael a validé
        @user = Factory.create(:user, :profile => Profile.new( :first_name => "bob", :last_name => "smith"))
    
    maxwell's avatar
    maxwell a validé
        request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user, :authenticate => @user)
      end
    
    
      describe 'receive endpoint' do
    
        it 'should accept a post from anohter node and save the information' do
          
          person = Factory.create(:person)
          message = StatusMessage.new(:message => 'foo', :person => person)
          StatusMessage.all.count.should == 0
          post :receive, {:xml => Post.build_xml_for(message)}
          StatusMessage.all.count.should == 1
        end
      end
    
    
    maxwell's avatar
    maxwell a validé
    end