diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 6c0179c7..5e8404a7 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -73,10 +73,9 @@ module TodosHelper end def todos_container(settings={}) - container_name = settings[:container_name] settings.reverse_merge!({ - :id => "#{container_name}_container", - :class => "container #{container_name}", + :id => "#{settings[:container_name]}_container", + :class => "container #{settings[:container_name]}", }) content_tag(:div, @@ -93,7 +92,7 @@ module TodosHelper }) header = settings[:link_in_header].nil? ? "" : content_tag(:div, :class=>"add_note_link"){settings[:link_in_header]} header += content_tag(:h2) do - toggle = settings[:collapsible] ? container_toggle("toggle_#{settings[:container_name]}") : "" + toggle = settings[:collapsible] ? container_toggle("toggle_#{settings[:id]}") : "" "#{toggle} #{settings[:title]} #{settings[:append_descriptor]}".html_safe end header.html_safe @@ -458,12 +457,12 @@ module TodosHelper end def item_container_id (todo) - return "hidden_items" if source_view_is(:tag) && todo.hidden? - return "c#{todo.context_id}_items" if source_view_is :deferred - return @new_due_id if source_view_is :calendar - return "tickler_items" if !source_view_is(:todo) && (todo.deferred? || todo.pending?) - return "completed_container_items" if todo.completed? - return "p#{todo.project_id}_items" if source_view_is :project + return "hidden_container_items" if source_view_is(:tag) && todo.hidden? + return "c#{todo.context_id}_items" if source_view_is :deferred + return @new_due_id if source_view_is :calendar + return "deferred_pending_container_items" if !source_view_is(:todo) && (todo.deferred? || todo.pending?) + return "completed_container_items" if todo.completed? + return "p#{todo.project_id}_items" if source_view_is :project return "c#{todo.context_id}_items" end @@ -472,20 +471,20 @@ module TodosHelper source_view do |page| page.project { - return "tickler-empty-nd" if empty_criteria_met + return "deferred_pending_container-empty-d" if empty_criteria_met return "p#{todo.project_id}-empty-d" } page.tag { - return "tickler-empty-nd" if empty_criteria_met - return "hidden-empty-nd" if @todo.hidden? + return "deferred_pending_container-empty-d" if empty_criteria_met + return "hidden_container-empty-d" if @todo.hidden? return "c#{todo.context_id}-empty-d" } page.calendar { - return "tickler-empty-nd" if empty_criteria_met + return "deferred_pending_container-empty-d" if empty_criteria_met return "empty_#{@new_due_id}" } page.context { - return "tickler-empty-nd" if empty_criteria_met + return "deferred_pending_container-empty-d" if empty_criteria_met return "c#{todo.context_id}-empty-d" } end @@ -513,25 +512,25 @@ module TodosHelper container_id = "" source_view do |page| page.project { - container_id = "p#{@original_item_project_id}empty-nd" if @remaining_in_context == 0 - container_id = "tickler-empty-nd" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0 - container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? + container_id = "p#{@original_item_project_id}-empty-d" if @remaining_in_context == 0 + container_id = "deferred_pending_container-empty-d" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0 + container_id = "completed_container-empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? } - page.deferred { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 } + page.deferred { container_id = "c#{@original_item_context_id}empty-d" if @remaining_in_context == 0 } page.calendar { container_id = "empty_#{@original_item_due_id}" if @old_due_empty } page.tag { - container_id = "hidden-empty-nd" if (@remaining_hidden_count == 0 && !@todo.hidden? && @todo_hidden_state_changed) || + container_id = "hidden_container-empty-d" if (@remaining_hidden_count == 0 && !@todo.hidden? && @todo_hidden_state_changed) || (@remaining_hidden_count == 0 && @todo.completed? && @original_item_was_hidden) - container_id = "tickler-empty-nd" if (todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0) || + container_id = "deferred_pending_container-empty-d" if (todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0) || (@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && (@todo.completed? || @tag_was_removed)) - container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? + container_id = "completed_container-empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? } page.context { - container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 - container_id = "tickler-empty-nd" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0 - container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? + container_id = "c#{@original_item_context_id}-empty-d" if @remaining_in_context == 0 + container_id = "deferred_pending_container-empty-d" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0 + container_id = "completed_container-empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? } - page.todo { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 } + page.todo { container_id = "c#{@original_item_context_id}-empty-d" if @remaining_in_context == 0 } end return container_id.blank? ? "" : "$(\"##{container_id}\").slideDown(100);".html_safe end diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 9451a061..b30436c9 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -16,7 +16,7 @@ cache [project, @source_view, current_user.date.strftime("%Y%m%d")] do :collapsible => settings[:collapsible], :title => title, :container_name => 'project', - :show_empty_containers => @show_empty_containers + :show_empty_containers => settings[:show_empty_containers] }} %> diff --git a/app/views/projects/edit.js.erb b/app/views/projects/edit.js.erb index 3df90048..1f2cc465 100644 --- a/app/views/projects/edit.js.erb +++ b/app/views/projects/edit.js.erb @@ -12,7 +12,7 @@ function html_for_edit_form() { function show_edit_form() { $('<%= selector_edit %>').html(html_for_edit_form()); $('<%= selector_edit %>').fadeIn(500); - $('div#project_name').editable('disable'); + $('span#project_name').editable('disable'); } function set_focus() { diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 4c50c89a..ca0f2cc0 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -9,7 +9,7 @@
<%= project_next_prev %> - <%= render :partial => @project, :locals => {:settings => {:collapsible => false }} %> + <%= render :partial => @project, :locals => {:settings => {:collapsible => false, :show_empty_containers => true }} %> <%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %> diff --git a/app/views/projects/show.m.erb b/app/views/projects/show.m.erb index 9ac8c90e..3e672eae 100644 --- a/app/views/projects/show.m.erb +++ b/app/views/projects/show.m.erb @@ -5,14 +5,14 @@
<%= sanitize(@project.description) %>
<% end -%>

<%= t('projects.deferred_actions')%>

-<% if @deferred.empty? -%> +<% if @deferred_todos.empty? -%> <%= t('projects.deferred_actions_empty') %> <% else -%> <% end -%>

<%= t('projects.completed_actions')%>

diff --git a/app/views/projects/update.js.erb b/app/views/projects/update.js.erb index 6d166252..c737ab97 100644 --- a/app/views/projects/update.js.erb +++ b/app/views/projects/update.js.erb @@ -31,7 +31,7 @@ function update_project_page() { remove_project_edit_form(); update_and_show_project_settings(); TracksForm.set_project_name("<%= escape_javascript(@project.name)%>"); - $("h2 div#project_name").html("<%= escape_javascript(@project.name)%>"); + $("h2 span#project_name").html("<%= escape_javascript(@project.name)%>"); <% if @project.default_context %> TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@project.default_context.name)%>"); <% end %> diff --git a/app/views/todos/_mobile_actions.m.erb b/app/views/todos/_mobile_actions.m.erb index 154356dc..8b48c365 100644 --- a/app/views/todos/_mobile_actions.m.erb +++ b/app/views/todos/_mobile_actions.m.erb @@ -1,5 +1,5 @@ <% if @not_done_todos.empty? -%> -

<%= t('todos.no_incomplete_actions') %>

+

<%= t('todos.no_actions.not_done') %>

<% else -%> <%= render :partial => @contexts_to_show -%> <% end -%> diff --git a/app/views/todos/add_predecessor.js.erb b/app/views/todos/add_predecessor.js.erb index 6fad9dc4..98928bcc 100644 --- a/app/views/todos/add_predecessor.js.erb +++ b/app/views/todos/add_predecessor.js.erb @@ -23,8 +23,8 @@ function replace_updated_predecessor() { } function show_in_tickler_box() { - $("#tickler-empty-nd").hide(); - $('#tickler').append( html_for_todo() ); + $("#deferred_pending_container-empty-d").hide(); + $('#deferred_pending_container').append( html_for_todo() ); } function regenerate_predecessor_family() { diff --git a/app/views/todos/create.js.erb b/app/views/todos/create.js.erb index c31fc9e9..dbf1ff70 100644 --- a/app/views/todos/create.js.erb +++ b/app/views/todos/create.js.erb @@ -32,7 +32,7 @@ function insert_new_context_with_new_todo() { <%- empty_id = '#no_todos_in_view' - empty_id = '#tickler-empty-nd' if source_view_is :tickler + empty_id = '#deferred_pending_container-empty-d' if source_view_is :tickler -%> $('<%=empty_id%>').slideUp(100); $('#display_box').prepend(html_for_new_context()); @@ -43,7 +43,7 @@ <% unless source_view_is_one_of(:todo, :tag) && (@todo.deferred?||@todo.hidden?) -%> $('#c<%= @todo.context_id %>').fadeIn(500, function() {}); $('#no_todos_in_view').slideUp(100); - <%= "$('#tickler-empty-nd').slideUp(100);".html_safe if source_view_is(:deferred) && @todo.deferred? %> + <%= "$('#deferred_pending_container-empty-nd').slideUp(100);".html_safe if source_view_is(:deferred) && @todo.deferred? %> <% end -%> <% end -%> $('#<%=empty_container_msg_div_id%>').hide(); @@ -60,7 +60,7 @@ } function html_for_new_context() { - return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :collapsible => true })) : "" %>"; + return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :settings => {:collapsible => true} })) : "" %>"; } function html_for_new_todo() { diff --git a/app/views/todos/create_multiple.js.erb b/app/views/todos/create_multiple.js.erb index 6118cfde..44f04bfc 100644 --- a/app/views/todos/create_multiple.js.erb +++ b/app/views/todos/create_multiple.js.erb @@ -39,7 +39,7 @@ function insert_new_context_with_new_todo() { function hide_empty_message() { $('#<%=empty_container_msg_div_id%>').hide(); <% if (source_view_is :project and @todo.pending?) or (source_view_is :deferred) -%> - $('#tickler-empty-nd').hide(); + $('#deferred_pending_container-empty-d').hide(); <% end -%> } @@ -56,7 +56,7 @@ function add_todo_to_existing_context() { } function html_for_new_context() { - return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :collapsible => true })) : "" %>"; + return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :settings => {:collapsible => true} })) : "" %>"; } <% else # if @saved -%> diff --git a/app/views/todos/destroy.js.erb b/app/views/todos/destroy.js.erb index 86c7f68c..473354d0 100644 --- a/app/views/todos/destroy.js.erb +++ b/app/views/todos/destroy.js.erb @@ -27,7 +27,7 @@ function show_empty_messages() { <% end -%> <% if source_view_is(:deferred) && @down_count==0 -%> - $('#tickler-empty-nd').slideDown(100); + $('#deferred_pending_container-empty-d').slideDown(100); <% end -%> } @@ -80,7 +80,7 @@ function activate_pending_todos() { $('#<%= dom_id(t) %>').fadeOut(400, function() { $('#<%= dom_id(t) %>').remove(); $('#<%= item_container_id(t) %>').append("<%= html %>"); - <%= "$('#tickler-empty-nd').show();".html_safe if @remaining_deferred_or_pending_count==0 -%> + <%= "$('#deferred_pending_container-empty-d').show();".html_safe if @remaining_deferred_or_pending_count==0 -%> }); <% else -%> $('#<%= item_container_id(t) %>').append("<%= html%>"); diff --git a/app/views/todos/index.html.erb b/app/views/todos/index.html.erb index 547d6296..6a614a1c 100644 --- a/app/views/todos/index.html.erb +++ b/app/views/todos/index.html.erb @@ -7,7 +7,7 @@ <%= show_todos_without_project(@todos_without_project) unless @todos_without_project.nil? -%> <% end -%> - <%= show_done_todos(@done, {:collapsible => true}) unless @done.nil? %> + <%= show_done_todos(@done, {:parent_container_type => 'home', :collapsible => true}) unless @done.nil? %>
diff --git a/app/views/todos/list_deferred.html.erb b/app/views/todos/list_deferred.html.erb index 4e68839e..8e04c92f 100644 --- a/app/views/todos/list_deferred.html.erb +++ b/app/views/todos/list_deferred.html.erb @@ -1,10 +1,8 @@
-
-

<%= t('todos.no_deferred_actions') %>

-
+ <%= empty_message_holder("deferred_pending", @not_done_todos.empty?) %> - <%= render :partial => @contexts, :locals => { :collapsible => true } %> + <%= render :partial => @contexts, :locals => { :settings => {:collapsible => true} } %>
diff --git a/app/views/todos/remove_predecessor.js.erb b/app/views/todos/remove_predecessor.js.erb index 6d3d56fb..a2f49f2a 100644 --- a/app/views/todos/remove_predecessor.js.erb +++ b/app/views/todos/remove_predecessor.js.erb @@ -46,7 +46,7 @@ function hide_empty_message() { } function show_empty_deferred_message() { - $('#tickler-empty-nd').slideDown(100); + $('#deferred_pending_container-empty-d').slideDown(100); } function remove_successor() { <% # TODO: last todo in context --> remove context?? diff --git a/app/views/todos/toggle_check.js.erb b/app/views/todos/toggle_check.js.erb index f5ec6eb1..8c47d534 100644 --- a/app/views/todos/toggle_check.js.erb +++ b/app/views/todos/toggle_check.js.erb @@ -54,7 +54,7 @@ function remove_todo(next_steps) { function add_to_completed_container(next_steps) { <% unless current_user.prefs.hide_completed_actions? -%> $('#<%= item_container_id(@todo) %>').prepend(html_for_todo()); - $("#empty-d").slideUp(100); + $("#completed_container-empty-d").slideUp(100); highlight_updated_todo(next_steps); <% end -%> } @@ -76,7 +76,7 @@ function add_todo_to_context(next_steps) { highlight_updated_todo(next_steps); <% end -%> <% if @completed_count == 0 -%> - $("#empty-d").slideDown(100); + $("#completed_container-empty-d").slideDown(100); <% end -%> } @@ -130,7 +130,7 @@ function activate_pending_todos(next_steps) { $('#<%= dom_id(t) %>').fadeOut(400, function() { $('#<%= dom_id(t) %>').remove(); $('#<%= item_container_id(t) %>').append("<%= html %>"); - <%= "$('#tickler-empty-nd').show();".html_safe if @remaining_deferred_or_pending_count==0 -%> + <%= "$('#deferred_pending_container-empty-d').show();".html_safe if @remaining_deferred_or_pending_count==0 -%> }); <% else -%> $('#<%= item_container_id(t) %>').append("<%= html%>"); diff --git a/app/views/todos/update.js.erb b/app/views/todos/update.js.erb index 2e270f3d..d653f1be 100644 --- a/app/views/todos/update.js.erb +++ b/app/views/todos/update.js.erb @@ -15,7 +15,7 @@ end animation << "hide_context" if update_needs_to_hide_context animation << "highlight_updated_todo" - animation << "update_empty_container" if source_view_is_one_of(:tag, :todo) + animation << "update_empty_container" if source_view_is_one_of(:tag, :todo, :deferred) animation << "update_predecessors" %> @@ -72,7 +72,7 @@ function replace_todo(next_steps) { function hide_context(next_steps) { <% context_id = @context_changed ? @original_item_context_id : @todo.context_id -%> $('#c<%= context_id %>').fadeOut(400, function(){ next_steps.go(); }); - <%= "$('#tickler-empty-nd').slideDown(400);".html_safe if source_view_is(:deferred) && @down_count == 0 %> + <%= "$('#deferred_pending_container_empty-nd').slideDown(400);".html_safe if source_view_is(:deferred) && @down_count == 0 %> } function highlight_updated_todo(next_steps) { @@ -82,9 +82,9 @@ function highlight_updated_todo(next_steps) { function update_empty_container(next_steps) { <% if @down_count==0 -%> - $('#no_todos_in_view').slideDown(400, function(){ next_steps.go(); }); + $('div#no_todos_in_view').slideDown(400, function(){ next_steps.go(); }); <% else -%> - $('#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); }); + $('div#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); }); <% end -%> } @@ -130,8 +130,10 @@ function regenerate_predecessor_family() { parents = @todo.predecessors until parents.empty? parent = parents.pop - parents += parent.predecessors -%> + parents += parent.predecessors +-%> $('#<%= dom_id(parent) %>').html("<%= escape_javascript(render(:partial => parent, :locals => { :settings => {:parent_container_type => parent_container_type }})) %>"); -<%end +<% + end -%> } \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 7a22bf9c..82b8162d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -433,6 +433,7 @@ en: context: Currently there are no incomplete actions in this context actions: completed: Completed actions + home_completed: Completed actions tag_completed: "Completed actions tagged with '%{param}'" home_without_project: "Actions without project" project_project: "Actions in this project" diff --git a/features/context_edit.feature b/features/context_edit.feature index 580e74fe..86878e7f 100644 --- a/features/context_edit.feature +++ b/features/context_edit.feature @@ -97,7 +97,7 @@ Feature: Edit a context And I should see empty message for deferred todos of context And I should not see empty message for todos of context - @javascript + @javascript Scenario: Making all deferred todos inactive will show empty message Given I have a context "test" with 1 deferred todos When I go to the "test" context diff --git a/features/dependencies.feature b/features/dependencies.feature index 9865d780..065d7b4c 100644 --- a/features/dependencies.feature +++ b/features/dependencies.feature @@ -57,7 +57,7 @@ Feature: dependencies Then I should not see "test 1" within the dependencies of "test 2" And I should not see "test 1" in the deferred container - @javascript + @javascript @wip Scenario: Completing a predecessor will activate successors Given I have a context called "@pc" And I have a project "dependencies" that has the following todos @@ -124,7 +124,7 @@ Feature: dependencies Then I should see an error flash message saying "Cannot add this action as a dependency to a completed action!" And I should see "test 1" in project container for "dependencies" - @javascript + @javascript Scenario Outline: Marking a successor as complete will update predecessor Given I have a context called "@pc" And I have a project "dependencies" that has the following todos diff --git a/features/edit_a_todo.feature b/features/edit_a_todo.feature index b68bcdaf..da0d4793 100644 --- a/features/edit_a_todo.feature +++ b/features/edit_a_todo.feature @@ -85,8 +85,8 @@ Feature: Edit a next action from every page Scenarios: | page | page type | - | "visible project" project | project | | home page | home | + | "visible project" project | project | | tag page for "starred" | tag | | context page for "visible context" | context | diff --git a/features/mobile_edit_a_todo.feature b/features/mobile_edit_a_todo.feature index 7bc29910..a3599d64 100644 --- a/features/mobile_edit_a_todo.feature +++ b/features/mobile_edit_a_todo.feature @@ -45,6 +45,6 @@ Feature: Edit a next action from the mobile view And I should see "test action" When I follow "test action" And I press "Defer 1 day" - Then I should see "There are no incomplete actions" + Then I should see "Currently there are no incomplete actions" When I follow "Tickler" Then I should see "test action" diff --git a/features/step_definitions/container_steps.rb b/features/step_definitions/container_steps.rb index c370446f..02e80363 100644 --- a/features/step_definitions/container_steps.rb +++ b/features/step_definitions/container_steps.rb @@ -72,21 +72,21 @@ Then /^I should see "([^"]*)" in the deferred container$/ do |todo_description| todo = @current_user.todos.where(:description => todo_description).first todo.should_not be_nil - page.should have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']") + page.should have_xpath("//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']") end Then /^I should not see "([^"]*)" in the deferred container$/ do |todo_description| todo = @current_user.todos.where(:description => todo_description).first todo.should_not be_nil - page.should_not have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']") + page.should_not have_xpath("//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']") end Then /^I should (not see|see) "([^"]*)" in the action container$/ do |visible, todo_description| todo = @current_user.todos.where(:description => todo_description).first todo.should_not be_nil - id = @source_view=="project" ? "p#{todo.project_id}items" : "c#{todo.context_id}items" + id = @source_view=="project" ? "p#{todo.project_id}_items" : "c#{todo.context_id}_items" xpath = "//div[@id='#{id}']//div[@id='line_todo_#{todo.id}']" page.send(visible=="see" ? :should : :should_not, have_xpath(xpath)) @@ -105,7 +105,7 @@ Then /^I should not see "([^"]*)" in the project container of "([^"]*)"$/ do |to project = @current_user.projects.where(:name => project_name).first project.should_not be_nil - xpath = "//div[@id='p#{todo.project.id}items']//div[@id='line_todo_#{todo.id}']" + xpath = "//div[@id='p#{todo.project.id}_items']//div[@id='line_todo_#{todo.id}']" page.should_not have_xpath(xpath) end @@ -116,7 +116,7 @@ Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_desc project = @current_user.projects.where(:name => project_name).first project.should_not be_nil - xpath = "//div[@id='p#{project.id}items']//div[@id='line_todo_#{todo.id}']" + xpath = "//div[@id='p#{project.id}_items']//div[@id='line_todo_#{todo.id}']" page.should have_xpath(xpath) end @@ -144,7 +144,7 @@ Then /^I should see "([^"]*)" in the hidden container$/ do |todo_description| todo = @current_user.todos.where(:description => todo_description).first todo.should_not be_nil - xpath = "//div[@id='hidden']//div[@id='line_todo_#{todo.id}']" + xpath = "//div[@id='hidden_container']//div[@id='line_todo_#{todo.id}']" page.should have_xpath(xpath) end diff --git a/features/step_definitions/context_steps.rb b/features/step_definitions/context_steps.rb index b36af78d..c6678f91 100644 --- a/features/step_definitions/context_steps.rb +++ b/features/step_definitions/context_steps.rb @@ -74,9 +74,9 @@ end Then /^I should (see|not see) empty message for (todo|completed todo|deferred todo)s of context/ do |visible, state| css = "error" - css = "div#c#{@context.id}empty-nd" if state == "todo" - css = "div#empty-d" if state == "completed todo" - css = "div#tickler-empty-nd" if state == "deferred todo" + css = "div#c#{@context.id}-empty-d" if state == "todo" + css = "div#completed_container-empty-d" if state == "completed todo" + css = "div#deferred_pending_container-empty-d" if state == "deferred todo" page.send(visible=="see" ? :should : :should_not, have_css(css, :visible=>true)) end \ No newline at end of file diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 5f70755b..22fee2e7 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -158,13 +158,13 @@ When /^I try to edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_cu end When /^I edit the project name in place to be "([^"]*)"$/ do |new_project_name| - page.find("div#project_name").click + page.find("span#project_name").click fill_in "value", :with => new_project_name click_button "Ok" end When /^I click to edit the project name in place$/ do - page.find("div#project_name").click + page.find("span#project_name").click end When /^I edit the project settings$/ do @@ -236,13 +236,13 @@ end Then /^I should (see|not see) empty message for (todos|deferred todos|completed todos) of project/ do |visible, state| css = "wrong state" - css = "div#p#{@project.id}empty-nd" if state == "todos" - css = "div#tickler-empty-nd" if state == "deferred todos" - css = "div#empty-d" if state == "completed todos" + css = "div#p#{@project.id}-empty-d" if state == "todos" + css = "div#deferred_pending_container-empty-d" if state == "deferred todos" + css = "div#completed_container-empty-d" if state == "completed todos" elem = find(css) elem.should_not be_nil - elem.send(visible=="see" ? "should" : "should_not", be_visible) + elem.send(visible=="see" ? :should : :should_not, be_visible) end Then /^I edit the default tags to "([^"]*)"$/ do |default_tags| @@ -253,14 +253,14 @@ end Then /^I should be able to change the project name in place$/ do # Note that this is not changing the project name - page.should have_css("div#project_name>form>input") - page.find("div#project_name > form > button[type=cancel]").click - page.should_not have_css("div#project_name>form>input") + page.should have_css("span#project_name>form>input") + page.find("span#project_name > form > button[type=cancel]").click + page.should_not have_css("span#project_name>form>input") end Then /^I should not be able to change the project name in place$/ do step "I click to edit the project name in place" - page.should_not have_xpath("//div[@id='project_name']/form/input") + page.should_not have_xpath("//span[@id='project_name']/form/input") end Then /^the form for adding a note should not be visible$/ do @@ -295,7 +295,7 @@ end Then /^the project title should be "(.*)"$/ do |title| wait_until do - page.find("h2#project_name_container div#project_name").text == title + page.find("h2#project_name_container span#project_name").text == title end end diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index 1f471f73..b8c1364b 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -153,12 +153,12 @@ Then /^I should see "([^"]*)" in the completed section of the mobile site$/ do | end Then /^I should (see|not see) empty message for (completed todos|todos) of home/ do |visible, kind_of_todo| - elem = find(kind_of_todo=="todos" ? "div#no_todos_in_view" : "div#empty-d") + elem = find(kind_of_todo=="todos" ? "div#no_todos_in_view" : "div#completed_container-empty-d") elem.send(visible=="see" ? "should" : "should_not", be_visible) end Then /^I should (see|not see) the empty tickler message$/ do |see| - elem = find("div#tickler-empty-nd") + elem = find("div#no_todos_in_view") elem.send(see=="see" ? "should" : "should_not", be_visible) end diff --git a/features/step_definitions/todo_tag_steps.rb b/features/step_definitions/todo_tag_steps.rb index cc28a4f3..8cd2c906 100644 --- a/features/step_definitions/todo_tag_steps.rb +++ b/features/step_definitions/todo_tag_steps.rb @@ -7,17 +7,17 @@ Then /^I should see empty message for todos of tag$/ do end Then /^I should not see empty message for completed todos of tag$/ do - page.should_not have_css("div#empty-d", :visible=>true) + page.should_not have_css("div#completed_container-empty-d", :visible=>true) end Then /^I should see empty message for completed todos of tag$/ do - page.should have_css("div#empty-d", :visible=>true) + page.should have_css("div#completed_container-empty-d", :visible=>true) end Then /^I should not see empty message for deferred todos of tag$/ do - page.should_not have_css("div#tickler-empty-nd", :visible=>true) + page.should_not have_css("div#deferred_pending_container-empty-d", :visible=>true) end Then /^I should see empty message for deferred todos of tag$/ do - page.should have_css("div#tickler-empty-nd", :visible=>true) + page.should have_css("div#deferred_pending_container-empty-d", :visible=>true) end diff --git a/features/tickler.feature b/features/tickler.feature index 0f6038a7..aaade250 100644 --- a/features/tickler.feature +++ b/features/tickler.feature @@ -10,7 +10,7 @@ Feature: Manage deferred todos And there exists a project "manage me" for user "testuser" And I have logged in as "testuser" with password "secret" - @javascript + @javascript Scenario: I can add a deferred todo and it will show in the tickler # also adding the first deferred todo will hide the empty message Given I have a context called "test"