diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index b6bed421..64ed3903 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -231,6 +231,7 @@ class ProjectsController < ApplicationController elsif boolean_param('update_default_tags') template = 'projects/update_default_tags' elsif boolean_param('update_project_name') + # clicking on a project name in the project view gives a form triggering this @projects = current_user.projects template = 'projects/update_project_name' else diff --git a/app/views/projects/update.js.erb b/app/views/projects/update.js.erb index 72df2f52..0d0cd00c 100644 --- a/app/views/projects/update.js.erb +++ b/app/views/projects/update.js.erb @@ -28,7 +28,6 @@ var <%=object_name%> = { <% end -%> ProjectListPage.update_all_states_count(<%=@active_projects_count%>, <%=@hidden_projects_count%>, <%=@completed_projects_count%>); ProjectListPage.show_or_hide_all_state_containers(<%= @show_active_projects %>, <%= @show_hidden_projects %>, <%= @show_completed_projects %>); - TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name)%>"); $('div.project-edit-current').removeClass('project-edit-current'); }, update_project_page: function() { diff --git a/features/add_todo_from_cli.feature b/features/add_todo_from_cli.feature index 01e0c842..442f74e5 100644 --- a/features/add_todo_from_cli.feature +++ b/features/add_todo_from_cli.feature @@ -33,4 +33,4 @@ Feature: Add a todo to Tracks on console """ When I execute the add-todo script - Then I should have 2 todo in project "Project A" + Then I should have 2 todos in project "Project A" diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 59592ac5..2824fbdd 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -306,7 +306,7 @@ Then /^I should have a project called "([^"]*)"$/ do |project_name| expect(project).to_not be_nil end -Then /^I should have (\d+) todo in project "([^"]*)"$/ do |todo_count, project_name| +Then /^I should have (\d+) todos? in project "([^"]*)"$/ do |todo_count, project_name| project = @current_user.projects.where(:name => project_name).first expect(project).to_not be_nil expect(project.todos.count).to eq(todo_count.to_i) diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index 83ed2975..b8216416 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -116,7 +116,7 @@ end Then /^the project field of the new todo form should contain "([^"]*)"$/ do |project_name| xpath= "//form[@id='todo-form-new-action']/input[@id='todo_project_name']" - expect(project_name).to eq(page.find(:xpath, xpath).value) + expect(page.find(:xpath, xpath).value).to eq(project_name) end Then /^the default context of the new todo form should be "([^"]*)"$/ do |context_name|