mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-10 11:18:51 +01:00
the project description could now contain markup, like notes
also configure database_cleaner for selenium features
This commit is contained in:
parent
25204f5efa
commit
c433661048
9 changed files with 60 additions and 9 deletions
|
|
@ -1,5 +1,9 @@
|
|||
<div class="container">
|
||||
<h2 id="project_name"><% if collapsible %><a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("collapse.png") %></a><% end %><%= project.name -%></h2>
|
||||
<h2 id="project_name">
|
||||
<% if collapsible -%>
|
||||
<a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("collapse.png") %></a>
|
||||
<% end -%>
|
||||
<%= project.name -%></h2>
|
||||
<div id="<%= dom_id(project, "container")%>">
|
||||
<%= render :partial => "projects/project_settings", :locals => { :project => project, :collapsible => collapsible } %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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)}"}
|
||||
) %>
|
||||
</div>
|
||||
<% unless project.description.blank? -%>
|
||||
<div class="project_description"><%= sanitize(project.description) %></div>
|
||||
<div class="project_description"><%= format_note(project.description) %></div>
|
||||
<% end -%>
|
||||
</div>
|
||||
<div id="<%= dom_id(project, 'edit') %>" class="edit-form" style="display:none;">
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
%>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ development:
|
|||
username: root
|
||||
password:
|
||||
|
||||
test:
|
||||
test: &TEST
|
||||
adapter: sqlite3
|
||||
database: ":memory:"
|
||||
|
||||
|
|
|
|||
|
|
@ -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'))
|
||||
|
|
|
|||
|
|
@ -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'))
|
||||
|
||||
|
|
|
|||
19
features/manage_project.feature
Normal file
19
features/manage_project.feature
Normal file
|
|
@ -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 "<i>successfull outcome<i>"
|
||||
And I should see " <b>done</b>"
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue