From 368570d1dee81570156fe2ab02f742650d316026 Mon Sep 17 00:00:00 2001 From: Shereef Bishay Date: Mon, 16 Nov 2009 11:10:35 -0800 Subject: [PATCH] Added selenium, cucumber, and webrat --- Rakefile | 1 - app/controllers/members_controller.rb | 2 + app/models/issue.rb | 13 ++--- app/views/mailer/_issue_text_html.rhtml | 2 +- app/views/mailer/_issue_text_plain.rhtml | 2 +- config/database.yml | 6 ++- config/environments/cucumber.rb | 5 ++ config/environments/selenium.rb | 31 ++++++++++++ config/environments/test.rb | 3 +- config/exceptional.yml | 7 ++- config/routes.rb | 6 ++- config/s3.yml | 6 ++- cucumber.yml | 2 + db/migrate/20091107051307_create_mails.rb | 2 +- features/ownership_offer.feature | 40 +++++++++++++-- features/step_definitions/email_steps.rb | 50 +++++++++++++++++++ features/step_definitions/global_steps.rb | 18 +++++++ features/step_definitions/workstream_steps.rb | 11 ++++ features/support/db_cleaner.rb | 11 ++++ features/support/env.rb | 10 ++++ features/support/paths.rb | 28 +++++++++++ features/support/selenium.rb | 18 +++++++ lib/redmine/default_data/loader.rb | 11 +++- lib/tasks/cucumber.rake | 3 +- lib/tasks/custom.rake | 12 +++++ lib/tasks/load_default_data.rake | 6 ++- spec/factories.rb | 45 +++++++++++++++++ spec/spec_helper.rb | 1 + 28 files changed, 328 insertions(+), 24 deletions(-) create mode 100644 config/environments/selenium.rb create mode 100644 cucumber.yml create mode 100644 features/step_definitions/email_steps.rb create mode 100644 features/step_definitions/global_steps.rb create mode 100644 features/step_definitions/workstream_steps.rb create mode 100644 features/support/db_cleaner.rb create mode 100644 features/support/selenium.rb create mode 100644 lib/tasks/custom.rake create mode 100644 spec/factories.rb diff --git a/Rakefile b/Rakefile index cffd19f0c1..94042172bf 100644 --- a/Rakefile +++ b/Rakefile @@ -6,5 +6,4 @@ require(File.join(File.dirname(__FILE__), 'config', 'boot')) require 'rake' require 'rake/testtask' require 'rake/rdoctask' - require 'tasks/rails' \ No newline at end of file diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index f6e0250faa..d8d63ac6e9 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -8,9 +8,11 @@ class MembersController < ApplicationController before_filter :authorize def new + logger.info(params.inspect) members = [] if params[:member] && request.post? attrs = params[:member].dup + logger.info("Attrs: #{attrs.inspect}") if (user_ids = attrs.delete(:user_ids)) user_ids.each do |user_id| members << Member.new(attrs.merge(:user_id => user_id)) diff --git a/app/models/issue.rb b/app/models/issue.rb index 002e5df02e..042fdf27ac 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -36,7 +36,7 @@ class Issue < ActiveRecord::Base acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]}, :author_key => :author_id - validates_presence_of :subject, :priority, :project, :tracker, :author, :status + validates_presence_of :subject, :project, :tracker, :author, :status #,:priority, validates_length_of :subject, :maximum => 255 validates_inclusion_of :done_ratio, :in => 0..100 validates_numericality_of :estimated_hours, :allow_nil => true @@ -57,7 +57,7 @@ def after_initialize if new_record? # set default values for new records only self.status ||= IssueStatus.default - self.priority ||= IssuePriority.default + # self.priority ||= IssuePriority.default end end @@ -134,10 +134,11 @@ def validate errors.add :start_date, :invalid end end - - def validate_on_create - errors.add :tracker_id, :invalid unless project.trackers.include?(tracker) - end + +# Commenting this since on bettermeans all projects will have same trackers + # def validate_on_create + # errors.add :tracker_id, :invalid unless project.trackers.include?(tracker) + # end def before_create # default assignment based on category diff --git a/app/views/mailer/_issue_text_html.rhtml b/app/views/mailer/_issue_text_html.rhtml index d0f2478127..bfdda0d5fa 100644 --- a/app/views/mailer/_issue_text_html.rhtml +++ b/app/views/mailer/_issue_text_html.rhtml @@ -3,7 +3,7 @@