diff --git a/app/views/projects/edit.js.erb b/app/views/projects/edit.js.erb index 1f986496..c13641d2 100644 --- a/app/views/projects/edit.js.erb +++ b/app/views/projects/edit.js.erb @@ -1,10 +1,17 @@ +<% + selector_edit = "div##{dom_id(@project, 'edit')}" + selector_edit = "div.project-edit-current " + selector unless @source_view="project" + selector_project = "div##{dom_id(@project)}" + selector_project = "div.project-edit-current " + selector unless @source_view="project" +-%> + function html_for_edit_form() { return "<%= escape_javascript(render(:partial => 'project_form', :object => @project)) %>"; } function show_edit_form() { - $('div.project-edit-current div#<%=dom_id(@project, 'edit')%>').html(html_for_edit_form()); - $('div.project-edit-current div#<%=dom_id(@project, 'edit')%>').fadeIn(500); + $('<%= selector_edit %>').html(html_for_edit_form()); + $('<%= selector_edit %>').fadeIn(500); $('div#project_name').editable('disable'); } @@ -13,11 +20,10 @@ function set_focus() { } function replace_project_with_edit_form() { - $('div.project-edit-current div#<%=dom_id(@project)%>').fadeOut(250, function() { + $('<%= selector_project %>').fadeOut(250, function() { show_edit_form(); set_focus(); }); } - -replace_project_with_edit_form(); +replace_project_with_edit_form(); \ No newline at end of file diff --git a/config/cucumber.yml b/config/cucumber.yml index 199cb582..0ccd3618 100644 --- a/config/cucumber.yml +++ b/config/cucumber.yml @@ -4,5 +4,5 @@ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'pr std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" %> default: <%= std_opts %> features -wip: --tags @wip:10 --wip features +wip: --tags @wip:15 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/features/context_edit.feature b/features/context_edit.feature index 073d197c..18aad0fe 100644 --- a/features/context_edit.feature +++ b/features/context_edit.feature @@ -12,7 +12,7 @@ Feature: Edit a context And I have a project called "test project" And I have 2 todos in project "test project" in context "@pc" with tags "starred" prefixed by "test_project " - @javascript @wip + @javascript Scenario: In place edit of context name Given I have a context called "Errands" When I go to the context page for "Errands" diff --git a/features/dependencies.feature b/features/dependencies.feature index 7513bdd0..28537faa 100644 --- a/features/dependencies.feature +++ b/features/dependencies.feature @@ -160,7 +160,7 @@ Feature: dependencies When I mark "test 1" as complete And I should see "test 1" in the completed container And I should see that "test 2" does not have dependencies - When I mark the complete todo "test 1" active + When I mark the completed todo "test 1" active Then I should not see "test 1" in the completed container And I should see "test 1" in the deferred container And I should see "test 1" within the dependencies of "test 2" diff --git a/features/edit_a_todo.feature b/features/edit_a_todo.feature index 8f2df123..b68bcdaf 100644 --- a/features/edit_a_todo.feature +++ b/features/edit_a_todo.feature @@ -116,7 +116,7 @@ Feature: Edit a next action from every page Then I should see empty message for todos of And I should not see the container for context "visible context" And I should not see empty message for completed todos of - When I mark the complete todo "visible todo" active + When I mark the completed todo "visible todo" active Then I should see the container for context "visible context" And I should see empty message for completed todos of And I should see "visible todo" in the context container for "visible context" @@ -133,7 +133,7 @@ Feature: Edit a next action from every page When I go to the Then I should see empty message for todos of And I should not see empty message for completed todos of - When I mark the complete todo "visible todo" active + When I mark the completed todo "visible todo" active And I should see empty message for completed todos of And I should not see empty message for todos of diff --git a/features/step_definitions/todo_edit_steps.rb b/features/step_definitions/todo_edit_steps.rb index 425732bc..e52614dd 100644 --- a/features/step_definitions/todo_edit_steps.rb +++ b/features/step_definitions/todo_edit_steps.rb @@ -18,8 +18,10 @@ When /^I mark "([^"]*)" as uncompleted$/ do |action_description| wait_for_ajax end -When /^I mark the complete todo "([^"]*)" active$/ do |action_description| +When /^I mark the completed todo "([^"]*)" active$/ do |action_description| step "I mark \"#{action_description}\" as uncompleted" + wait_for_ajax + wait_for_animations_to_end end ####### (UN)STARRING ####### diff --git a/features/view_done.feature b/features/view_done.feature index ba4ff8db..cac54a20 100644 --- a/features/view_done.feature +++ b/features/view_done.feature @@ -137,7 +137,7 @@ Feature: Show done Scenario Outline: I can toggle a todo active from the done pages When I go to the Then I should see "todo 1" - When I mark the complete todo "todo 1" active + When I mark the completed todo "todo 1" active Then I should not see "todo 1" When I go to the Then I should see "todo 1"