mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 01:30:12 +01:00
Show context on un-hidden successor. Fixes #964
Added another todo fixture, which broke some assertions that I had to fix
This commit is contained in:
parent
93b83e8682
commit
21de49c87a
7 changed files with 29 additions and 6 deletions
|
|
@ -262,9 +262,10 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty_container_msg_div_id
|
def empty_container_msg_div_id
|
||||||
return "tickler-empty-nd" if source_view_is_one_of(:project, :tag) && @todo.deferred?
|
todo = @todo || @successor
|
||||||
return "p#{@todo.project_id}empty-nd" if source_view_is :project
|
return "tickler-empty-nd" if source_view_is_one_of(:project, :tag) && todo.deferred?
|
||||||
return "c#{@todo.context_id}empty-nd"
|
return "p#{todo.project_id}empty-nd" if source_view_is :project
|
||||||
|
return "c#{todo.context_id}empty-nd"
|
||||||
end
|
end
|
||||||
|
|
||||||
def project_names_for_autocomplete
|
def project_names_for_autocomplete
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ if @removed
|
||||||
# update display if pending->active
|
# update display if pending->active
|
||||||
if @successor.active?
|
if @successor.active?
|
||||||
page[@successor].remove unless source_view_is_one_of(:todo, :context)
|
page[@successor].remove unless source_view_is_one_of(:todo, :context)
|
||||||
|
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil?
|
||||||
|
page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@successor.context_id}"
|
||||||
page.insert_html :bottom, item_container_id(@successor), :partial => 'todos/todo', :locals => {
|
page.insert_html :bottom, item_container_id(@successor), :partial => 'todos/todo', :locals => {
|
||||||
:todo => @successor, :parent_container_type => parent_container_type }
|
:todo => @successor, :parent_container_type => parent_container_type }
|
||||||
page.visual_effect :highlight, dom_id(@successor, 'line'), {'startcolor' => "'#99ff99'"}
|
page.visual_effect :highlight, dom_id(@successor, 'line'), {'startcolor' => "'#99ff99'"}
|
||||||
|
|
|
||||||
3
test/fixtures/dependencies.yml
vendored
Normal file
3
test/fixtures/dependencies.yml
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
buy_stock_then_email_broker:
|
||||||
|
successor_id: 19
|
||||||
|
predecessor_id: 11
|
||||||
11
test/fixtures/todos.yml
vendored
11
test/fixtures/todos.yml
vendored
|
|
@ -243,4 +243,13 @@ call_bill_gates_every_day:
|
||||||
due: <%= last_week %>
|
due: <%= last_week %>
|
||||||
completed_at: ~
|
completed_at: ~
|
||||||
show_from: ~
|
show_from: ~
|
||||||
recurring_todo_id: 1
|
recurring_todo_id: 1
|
||||||
|
|
||||||
|
email_broker:
|
||||||
|
id: 19
|
||||||
|
user_id: 1
|
||||||
|
context_id: 3
|
||||||
|
description: Ask about better stocks
|
||||||
|
notes: ~
|
||||||
|
state: pending
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class StatsControllerTest < ActionController::TestCase
|
||||||
assert_equal 3, assigns['projects'].count
|
assert_equal 3, assigns['projects'].count
|
||||||
assert_equal 3, assigns['projects'].count(:conditions => "state = 'active'")
|
assert_equal 3, assigns['projects'].count(:conditions => "state = 'active'")
|
||||||
assert_equal 10, assigns['contexts'].count
|
assert_equal 10, assigns['contexts'].count
|
||||||
assert_equal 16, assigns['actions'].count
|
assert_equal 17, assigns['actions'].count
|
||||||
assert_equal 4, assigns['tags_count']
|
assert_equal 4, assigns['tags_count']
|
||||||
assert_equal 2, assigns['unique_tags_count']
|
assert_equal 2, assigns['unique_tags_count']
|
||||||
assert_equal 2.week.ago.at_midnight, assigns['first_action'].created_at.at_midnight
|
assert_equal 2.week.ago.at_midnight, assigns['first_action'].created_at.at_midnight
|
||||||
|
|
|
||||||
8
test/selenium/dependencies/unhide_hidden_context.rsel
Normal file
8
test/selenium/dependencies/unhide_hidden_context.rsel
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Test for issue #964
|
||||||
|
setup :fixtures => :all
|
||||||
|
login :as => 'admin'
|
||||||
|
Todo.create(:context => Context.find(3), :description => 'foo')
|
||||||
|
open "/"
|
||||||
|
click "css=#successor_todo_19 img.delete_item"
|
||||||
|
wait_for_visible 'flash'
|
||||||
|
assert_visible 'c3'
|
||||||
|
|
@ -31,5 +31,5 @@ wait_for_text 'css=h1 span.count', '2'
|
||||||
|
|
||||||
# just test the navigation.
|
# just test the navigation.
|
||||||
click_and_wait "link=Tickler"
|
click_and_wait "link=Tickler"
|
||||||
wait_for_text 'css=h1 span.count', '0'
|
wait_for_text 'css=h1 span.count', '1'
|
||||||
click_and_wait "link=Feeds"
|
click_and_wait "link=Feeds"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue