fix regression for editing project settings from project page

This commit is contained in:
Reinier Balt 2012-04-03 13:41:09 +02:00
parent 0012a56ecb
commit 2aef2b5622
7 changed files with 20 additions and 12 deletions

View file

@ -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();

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -116,7 +116,7 @@ Feature: Edit a next action from every page
Then I should see empty message for todos of <page type>
And I should not see the container for context "visible context"
And I should not see empty message for completed todos of <page type>
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 <page type>
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 <page>
Then I should see empty message for todos of <page type>
And I should not see empty message for completed todos of <page type>
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 <page type>
And I should not see empty message for todos of <page type>

View file

@ -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 #######

View file

@ -137,7 +137,7 @@ Feature: Show done
Scenario Outline: I can toggle a todo active from the done pages
When I go to the <page>
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 <next page>
Then I should see "todo 1" <where>