also update default_context_name

New actions are created with the context as defined in
default_context_name. This value needs to be updated as shown in #1789.
This commit is contained in:
Carsten Otto 2015-05-25 11:57:10 +02:00
parent f8f7762b94
commit 426b0fca20
3 changed files with 10 additions and 1 deletions

View file

@ -18,7 +18,7 @@ var <%=object_name%> = {
<% else -%>
<%=object_name%>.replace_context_form_with_updated_context();
<% end -%>
TracksForm.set_context_name("<%= escape_javascript(@context.name)%>");
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@context.name)%>");
},
remove_and_re_add_context: function() {
$('#<%=dom_id(@context, 'container')%>').slideUp(500, function() {

View file

@ -28,6 +28,14 @@ Feature: Edit a context
And I edit the context name in place to be "OutAndAbout"
Then the context field of the new todo form should contain "OutAndAbout"
# Ticket #1789
@javascript
Scenario: I can change the name of the context and it should still allow me to add new actions
When I go to the context page for "@pc"
And I edit the context name in place to be "OutAndAbout"
And I submit a new action with description "a new next action"
Then I should see the todo "a new next action"
@javascript
Scenario: Editing the context of a todo will remove the todo
When I go to the the context page for "@pc"

View file

@ -54,6 +54,7 @@ When /^I edit the context name in place to be "([^\"]*)"$/ do |new_context_name|
page.find("span#context_name").click
fill_in "value", :with => new_context_name
click_button "Ok"
wait_for_ajax
end
Then /^I should see the context name is "([^\"]*)"$/ do |context_name|