mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
#2534: Test setting the due date in calendar view.
This commit is contained in:
parent
813149239f
commit
b9b2a3f5d5
1 changed files with 26 additions and 0 deletions
|
@ -346,6 +346,32 @@ class TodosControllerTest < ActionController::TestCase
|
|||
assert_equal 1, t.project_id
|
||||
end
|
||||
|
||||
def test_update_todo_due_date
|
||||
t = Todo.find(1)
|
||||
login_as(:admin_user)
|
||||
|
||||
due_today_date = Time.zone.now
|
||||
due_tomorrow_date = due_today_date + 1.day
|
||||
due_this_week_date = Time.zone.now.end_of_week - 1.day
|
||||
due_next_week_date = due_this_week_date + 7.days - 1.day
|
||||
due_this_month_date = Time.zone.now.end_of_month - 1.day
|
||||
|
||||
post :update, xhr: true, params: { :id => 1, :_source_view => 'calendar', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>due_today_date.strftime("%d/%m/%Y")}, "tag_list"=>"foo bar" }
|
||||
assert_response 200
|
||||
|
||||
post :update, xhr: true, params: { :id => 1, :_source_view => 'calendar', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>due_tomorrow_date.strftime("%d/%m/%Y")}, "tag_list"=>"foo bar" }
|
||||
assert_response 200
|
||||
|
||||
post :update, xhr: true, params: { :id => 1, :_source_view => 'calendar', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>due_this_week_date.strftime("%d/%m/%Y")}, "tag_list"=>"foo bar" }
|
||||
assert_response 200
|
||||
|
||||
post :update, xhr: true, params: { :id => 1, :_source_view => 'calendar', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>due_next_week_date.strftime("%d/%m/%Y")}, "tag_list"=>"foo bar" }
|
||||
assert_response 200
|
||||
|
||||
post :update, xhr: true, params: { :id => 1, :_source_view => 'calendar', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"id"=>"1", "notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>due_this_month_date.strftime("%d/%m/%Y")}, "tag_list"=>"foo bar" }
|
||||
assert_response 200
|
||||
end
|
||||
|
||||
def test_update_todo_delete_project
|
||||
t = Todo.find(1)
|
||||
login_as(:admin_user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue