mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 12:08:47 +01:00
Move the calendar to its own controller
This commit is contained in:
parent
70fc1848c2
commit
d1ff0daf6f
6 changed files with 97 additions and 26 deletions
30
test/functional/calendar_controller_test.rb
Normal file
30
test/functional/calendar_controller_test.rb
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
require_relative '../test_helper'
|
||||
|
||||
class CalendarControllerTest < ActionController::TestCase
|
||||
def test_show
|
||||
login_as(:admin_user)
|
||||
|
||||
get :show
|
||||
|
||||
projects = [projects(:timemachine),
|
||||
projects(:moremoney),
|
||||
projects(:gardenclean)]
|
||||
due_today = [todos(:phone_grandfather),
|
||||
todos(:call_bill_gates_every_day),
|
||||
todos(:due_today)]
|
||||
due_next_week = [todos(:buy_shares),
|
||||
todos(:buy_stego_bait),
|
||||
todos(:new_action_in_context)]
|
||||
due_this_month = [todos(:call_bill),
|
||||
todos(:call_dino_ext)]
|
||||
|
||||
assert_equal "calendar", assigns['source_view']
|
||||
assert_equal projects, assigns['projects']
|
||||
assert_equal due_today, assigns['calendar'].due_today
|
||||
assert_equal [], assigns['calendar'].due_this_week
|
||||
assert_equal due_next_week, assigns['calendar'].due_next_week
|
||||
assert_equal due_this_month, assigns['calendar'].due_this_month
|
||||
assert_equal [], assigns['calendar'].due_after_this_month
|
||||
assert_equal 8, assigns['count']
|
||||
end
|
||||
end
|
||||
|
|
@ -898,29 +898,4 @@ class TodosControllerTest < ActionController::TestCase
|
|||
assert t4.pending?, "t4 should remain pending"
|
||||
assert t4.predecessors.map(&:id).include?(t3.id)
|
||||
end
|
||||
|
||||
|
||||
def test_calendar
|
||||
login_as(:admin_user)
|
||||
|
||||
get :calendar
|
||||
|
||||
projects = [projects(:timemachine),
|
||||
projects(:moremoney),
|
||||
projects(:gardenclean)]
|
||||
due_today = [todos(:phone_grandfather),
|
||||
todos(:call_bill_gates_every_day),
|
||||
todos(:due_today)]
|
||||
due_next_week = [todos(:buy_shares),
|
||||
todos(:buy_stego_bait),
|
||||
todos(:new_action_in_context)]
|
||||
|
||||
assert_equal "calendar", assigns['source_view']
|
||||
assert_equal projects, assigns['projects']
|
||||
assert_equal due_today, assigns['calendar'].due_today
|
||||
assert_equal [], assigns['calendar'].due_this_week
|
||||
assert_equal due_next_week, assigns['calendar'].due_next_week
|
||||
assert_equal [], assigns['calendar'].due_this_month
|
||||
assert_equal 8, assigns['count']
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue