From 36e63a4ad90579ac145ef3a2fe2e0fc8283441b8 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Fri, 15 Oct 2010 12:39:29 +0200 Subject: [PATCH] fix and test toggling of new-project-form --- app/views/projects/index.html.erb | 4 ++-- features/manage_list_of_projects.feature | 10 +++++++++- features/step_definitions/project_list_steps.rb | 10 +++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 0c396c15..5e1d81d7 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -12,8 +12,8 @@
-
- « <%= t('projects.hide_form') %> +
diff --git a/features/manage_list_of_projects.feature b/features/manage_list_of_projects.feature index 137592bb..448f5a14 100644 --- a/features/manage_list_of_projects.feature +++ b/features/manage_list_of_projects.feature @@ -56,8 +56,16 @@ Feature: Manage the list of projects When I drag the project "manage me" below "upgrade jquery" Then the project "upgrade jquery" should be above the project "manage me" + @selenium, @wip + Scenario: Hiding and unhiding the new project form + When I go to the projects page + Then the new project form should be visible + When I follow "« Hide form" + Then the new project form should not be visible + When I follow "Create a new project »" + Then the new project form should be visible + 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/step_definitions/project_list_steps.rb b/features/step_definitions/project_list_steps.rb index 150ad5fc..7f140a3a 100644 --- a/features/step_definitions/project_list_steps.rb +++ b/features/step_definitions/project_list_steps.rb @@ -50,4 +50,12 @@ end Then /^the project list badge for "([^"]*)" projects should show (\d+)$/ do |state_name, count| selenium.get_text("xpath=//span[@id='#{state_name}-projects-count']").should == count -end \ No newline at end of file +end + +Then /^the new project form should be visible$/ do + selenium.is_visible("project_new").should == true +end + +Then /^the new project form should not be visible$/ do + selenium.is_visible("project_new").should == false +end