From 641c27d75300ff74bbeff072a0af8a0520ffd0c2 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 6 Oct 2010 20:37:21 +0200 Subject: [PATCH] start on the tests for the project list page --- app/views/projects/update.js.erb | 2 +- ...project.feature => edit_a_project.feature} | 2 +- features/manage_list_of_projects.feature | 40 +++++++++++++++++++ features/support/paths.rb | 4 ++ 4 files changed, 46 insertions(+), 2 deletions(-) rename features/{manage_project.feature => edit_a_project.feature} (98%) create mode 100644 features/manage_list_of_projects.feature diff --git a/app/views/projects/update.js.erb b/app/views/projects/update.js.erb index f8390175..c97de018 100644 --- a/app/views/projects/update.js.erb +++ b/app/views/projects/update.js.erb @@ -2,7 +2,7 @@ pageNotify('notice', '<%=t('projects.project_saved_status')%>', 5); <% if source_view_is :project_list -%> <% if @state_changed -%> - <% else -%> + <% else # TODO!!!-%> <% end -%> <% else # source_view must be :project %> $('#<%=dom_id(@project, 'edit')%>').hide(); diff --git a/features/manage_project.feature b/features/edit_a_project.feature similarity index 98% rename from features/manage_project.feature rename to features/edit_a_project.feature index 58307109..6d2710fe 100644 --- a/features/manage_project.feature +++ b/features/edit_a_project.feature @@ -1,4 +1,4 @@ -Feature: Manage a project +Feature: Edit a project In order to reach a goal by doing several related todos As a Tracks user diff --git a/features/manage_list_of_projects.feature b/features/manage_list_of_projects.feature new file mode 100644 index 00000000..14822f4a --- /dev/null +++ b/features/manage_list_of_projects.feature @@ -0,0 +1,40 @@ +Feature: Manage the list of projects + + In order to keep tracks and manage of all my projects + As a Tracks user + I want to manage the list of projects + + Background: + Given the following user record + | login | password | is_admin | + | testuser | secret | false | + And I have logged in as "testuser" with password "secret" + And there exists a project "manage me" for user "testuser" + And there exists a project "upgrade jquery" for user "testuser" + And there exists a project "a project name starting with a" for user "testuser" + + Scenario: The list of project contain all projects + When I go to the projects page + Then I should see "manage me" + And I should see "upgrade jquery" + And the badge should show 2 + + Scenario: Clicking on a project takes me to the project page + When I go to the projects page + And I follow "manage me" + Then I should be on the "manage me" project page + + @selenium + Scenario: Editing a project name will update the list + When I go to the projects page + And I edit the project name for "manage me" to "manage him" + Then I should see "manage him" + + Scenario: Dragging a project to change list order of projects + Scenario: Deleting a project will remove it from the list + Scenario: Changing project state will move project to other state list + Scenario: Adding a new project + Scenario: Adding a new project and take me to the project page + Scenario: Hiding and unhiding the new project form + Scenario: Sorting the project alphabetically + Scenario: Sorting the project by number of task \ No newline at end of file diff --git a/features/support/paths.rb b/features/support/paths.rb index 57277a91..96e04562 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -20,6 +20,8 @@ module NavigationHelpers notes_path when /the contexts page/ contexts_path + when /the projects page/ + projects_path when /the manage users page/ users_path when /the repeating todos page/ @@ -44,6 +46,8 @@ module NavigationHelpers context_path(User.find_by_login($2).contexts.find_by_name($1)) when /the "([^\"]*)" project for user "([^\"]*)"/i project_path(User.find_by_login($2).projects.find_by_name($1)) + when /the "([^\"]*)" project/i + project_path(@current_user.projects.find_by_name($1)) # Add more mappings here. # Here is an example that pulls values out of the Regexp: