diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index ccae4c0d..d1cdfa60 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -154,10 +154,10 @@ module TodosHelper def remote_edit_button(todo=@todo) link_to( - image_tag("blank.png", :alt => t('todos.edit'), :align => "absmiddle", :id => 'edit_icon_todo_'+todo.id.to_s, :class => 'edit_item'), - {:controller => 'todos', :action => 'edit', :id => todo.id}, + image_tag("blank.png", :alt => t('todos.edit'), :align => "absmiddle", :id => dom_id(todo, "edit_icon"), :class => 'edit_item'), + edit_todo_path(todo), :class => "icon edit_item", - :id => "icon_edit_todo_#{todo.id}", + :id => dom_id(todo, "icon_edit"), :title => t('todos.edit_action_with_description', :description => todo.description)) end diff --git a/test/helpers/todo_helpers_test.rb b/test/helpers/todo_helpers_test.rb new file mode 100644 index 00000000..4d0940a7 --- /dev/null +++ b/test/helpers/todo_helpers_test.rb @@ -0,0 +1,10 @@ +require "test_helper" + +class TodosHelpersTest < ActionView::TestCase + include TodosHelper + + test "remote_edit_button" do + html = remote_edit_button(todos(:call_bill)) + assert_equal "\"Edit\"", html + end +end