diff --git a/app/views/projects/_project.rhtml b/app/views/projects/_project.rhtml
index cce7436c..943bb4bb 100644
--- a/app/views/projects/_project.rhtml
+++ b/app/views/projects/_project.rhtml
@@ -1,5 +1,9 @@
-
+
">
<%= render :partial => "projects/project_settings", :locals => { :project => project, :collapsible => collapsible } %>
diff --git a/app/views/projects/_project_settings.rhtml b/app/views/projects/_project_settings.rhtml
index 1c3747e0..5bea674d 100644
--- a/app/views/projects/_project_settings.rhtml
+++ b/app/views/projects/_project_settings.rhtml
@@ -20,11 +20,12 @@
:method => 'get',
:with => "'_source_view=#{@source_view}'",
:before => "$('#{dom_id(project)}').block({message: null});",
- :complete => "$('#{dom_id(project)}').unblock();enable_rich_interaction();"
+ :complete => "$('#{dom_id(project)}').unblock();enable_rich_interaction();",
+ :html => {:id => "link_edit_#{dom_id(project)}"}
) %>
<% unless project.description.blank? -%>
- <%= sanitize(project.description) %>
+ <%= format_note(project.description) %>
<% end -%>
diff --git a/config/cucumber.yml b/config/cucumber.yml
index 080025da..b639c79d 100644
--- a/config/cucumber.yml
+++ b/config/cucumber.yml
@@ -1,6 +1,6 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
-rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+rerun_opts = rerun.to_s.strip.empty? ? "--format progress " : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
requires = "-r features/support/env.rb -r features/step_definitions"
std_opts = "#{rerun_opts} #{requires} --format rerun --out rerun.txt --strict --tags ~@wip"
%>
diff --git a/config/database.yml.tmpl b/config/database.yml.tmpl
index d7738ac5..00d192cd 100644
--- a/config/database.yml.tmpl
+++ b/config/database.yml.tmpl
@@ -5,7 +5,7 @@ development:
username: root
password:
-test:
+test: &TEST
adapter: sqlite3
database: ":memory:"
diff --git a/config/environments/cucumber.rb b/config/environments/cucumber.rb
index 26c08a08..f3ddb3bb 100644
--- a/config/environments/cucumber.rb
+++ b/config/environments/cucumber.rb
@@ -22,7 +22,6 @@ config.action_controller.allow_forgery_protection = false
config.action_mailer.delivery_method = :test
config.gem 'cucumber-rails', :lib => false, :version => '>=0.2.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
-config.gem 'database_cleaner', :lib => false, :version => '>=0.2.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
config.gem 'webrat', :lib => false, :version => '>=0.6.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
config.gem 'rspec', :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
config.gem 'rspec-rails', :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
diff --git a/config/environments/selenium.rb b/config/environments/selenium.rb
index 26c08a08..b933322c 100644
--- a/config/environments/selenium.rb
+++ b/config/environments/selenium.rb
@@ -22,8 +22,9 @@ config.action_controller.allow_forgery_protection = false
config.action_mailer.delivery_method = :test
config.gem 'cucumber-rails', :lib => false, :version => '>=0.2.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
-config.gem 'database_cleaner', :lib => false, :version => '>=0.2.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
config.gem 'webrat', :lib => false, :version => '>=0.6.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
config.gem 'rspec', :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
config.gem 'rspec-rails', :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
+config.gem 'database_cleaner', :lib => false, :version => '>=0.2.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
+
diff --git a/features/manage_project.feature b/features/manage_project.feature
new file mode 100644
index 00000000..e6f35278
--- /dev/null
+++ b/features/manage_project.feature
@@ -0,0 +1,19 @@
+Feature: Manage a project
+
+ In order to reach a goal by doing several related todos
+ As a Tracks user
+ I want to manage these todos in a project
+
+ 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"
+
+ @selenium
+ Scenario: I can describe the project using markup
+ When I visit the "manage me" project
+ And I edit the project description to "_successfull outcome_: project is *done*"
+ Then I should see "successfull outcome"
+ And I should see " done"
\ No newline at end of file
diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb
index 585dcfe8..bc3138a4 100644
--- a/features/step_definitions/project_steps.rb
+++ b/features/step_definitions/project_steps.rb
@@ -1,4 +1,17 @@
When /^I visit the "([^\"]*)" project$/ do |project_name|
- project = Project.find_by_name(project_name)
- visit project_path(project)
+ @project = Project.find_by_name(project_name)
+ @project.should_not be_nil
+ visit project_path(@project)
+end
+
+Given /^there exists a project "([^\"]*)" for user "([^\"]*)"$/ do |project_name, user_name|
+ user = User.find_by_login(user_name)
+ user.should_not be_nil
+ user.projects.create!(:name => project_name)
+end
+
+When /^I edit the project description to "([^\"]*)"$/ do |new_description|
+ click_link "link_edit_project_#{@project.id}"
+ fill_in "project[description]", new_description
+ click_button "submit_project_#{@project.id}"
end
diff --git a/features/support/selenium.rb b/features/support/selenium.rb
index 72a44a7c..3796a754 100644
--- a/features/support/selenium.rb
+++ b/features/support/selenium.rb
@@ -5,3 +5,17 @@ Webrat.configure do |config|
end
Cucumber::Rails::World.use_transactional_fixtures = false
+
+require 'database_cleaner'
+
+# clean the database once when starting
+DatabaseCleaner.clean_with :truncation
+DatabaseCleaner.strategy = :truncation
+
+Before do
+ DatabaseCleaner.start
+end
+
+After do
+ DatabaseCleaner.clean
+end