diaspora/spec/controllers/dashboards_controller_spec.rb

22 lines
588 B
Ruby

require File.dirname(__FILE__) + '/../spec_helper'
describe DashboardsController do
render_views
before do
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user)
Factory.create(:user, :profile => Profile.create( :first_name => "bob", :last_name => "smith"))
end
it "index action should render index template" do
get :index
response.should render_template(:index)
end
it "on index sets a person's variable" do
Factory.create :person
get :index
assigns[:people].should == Person.friends.all
end
end