fix failing specs

This commit is contained in:
Reinier Balt 2011-08-16 11:49:04 +02:00
parent a8f4199adc
commit c6c51ee83c
6 changed files with 28 additions and 98 deletions

View file

@ -26,21 +26,6 @@ describe User do
with_dependent(:delete_all)
end
# TODO: uses fixtures to test those
it 'has many active_projects' do
User.should have_many(:active_projects).
with_order('projects.position ASC').
with_conditions('state = ?', 'active').
with_class_name('Project')
end
it 'has many active contexts' do
User.should have_many(:active_contexts).
with_order('position ASC').
with_conditions('hide = ?', false).
with_class_name('Context')
end
it 'has many todos' do
User.should have_many(:todos).
with_order('todos.completed_at DESC, todos.created_at DESC').
@ -54,14 +39,6 @@ describe User do
with_class_name('Todo')
end
it 'has many completed todos' do
User.should have_many(:completed_todos).
with_order('todos.completed_at DESC').
with_conditions('todos.state = ? AND NOT(todos.completed_at IS NULL)', 'completed').
with_include(:project, :context).
with_class_name('Todo')
end
it 'has many notes' do
User.should have_many(:notes).
with_order('created_at DESC').
@ -179,7 +156,8 @@ describe User do
user.preference.update_attribute('time_zone', 'Pacific Time (US & Canada)')
# Time.zone = 'Pacific Time (US & Canada)'
Time.stub!(:now).and_return(Time.new.end_of_day - 20.minutes)
todo = user.todos.build(:description => 'test task', :context => context, :show_from => user.date + 1.days)
todo = user.todos.build(:description => 'test task', :context => context)
todo.show_from = user.date + 1.days
todo.save!
user.deferred_todos.find_and_activate_ready