mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-09 06:02:36 +01:00
fix failing specs
This commit is contained in:
parent
a8f4199adc
commit
c6c51ee83c
6 changed files with 28 additions and 98 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue