email_spec 0.6.6 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. data/History.txt +21 -26
  2. data/README.rdoc +5 -3
  3. data/Rakefile +16 -27
  4. data/examples/rails3_root/Gemfile +17 -0
  5. data/examples/rails3_root/Gemfile.lock +138 -0
  6. data/examples/rails3_root/README +5 -0
  7. data/examples/rails3_root/Rakefile +11 -0
  8. data/examples/rails3_root/app/controllers/application_controller.rb +3 -0
  9. data/examples/rails3_root/app/controllers/welcome_controller.rb +16 -0
  10. data/examples/rails3_root/app/helpers/application_helper.rb +2 -0
  11. data/examples/rails3_root/app/mailers/user_mailer.rb +39 -0
  12. data/examples/{rails_root → rails3_root}/app/models/user.rb +0 -0
  13. data/examples/{rails_root/app/views/user_mailer/attachments.erb → rails3_root/app/views/user_mailer/attachments.html.erb} +0 -0
  14. data/examples/{rails_root/app/views/user_mailer/newsletter.erb → rails3_root/app/views/user_mailer/newsletter.html.erb} +0 -0
  15. data/examples/{rails_root/app/views/user_mailer/signup.erb → rails3_root/app/views/user_mailer/signup.html.erb} +1 -0
  16. data/examples/rails3_root/app/views/user_mailer/signup.text.erb +4 -0
  17. data/examples/{rails_root → rails3_root}/app/views/welcome/attachments.html.erb +0 -0
  18. data/examples/{rails_root → rails3_root}/app/views/welcome/confirm.html.erb +0 -0
  19. data/examples/{rails_root → rails3_root}/app/views/welcome/index.html.erb +1 -1
  20. data/examples/{rails_root → rails3_root}/app/views/welcome/newsletter.html.erb +0 -0
  21. data/examples/{rails_root → rails3_root}/app/views/welcome/signup.html.erb +0 -0
  22. data/examples/{rails_root → rails3_root}/attachments/document.pdf +0 -0
  23. data/examples/{rails_root → rails3_root}/attachments/image.png +0 -0
  24. data/examples/rails3_root/config.ru +4 -0
  25. data/examples/rails3_root/config/application.rb +43 -0
  26. data/examples/rails3_root/config/boot.rb +14 -0
  27. data/examples/rails3_root/config/cucumber.yml +8 -0
  28. data/examples/{rails_root → rails3_root}/config/database.yml +0 -0
  29. data/examples/rails3_root/config/environment.rb +6 -0
  30. data/examples/rails3_root/config/environments/development.rb +20 -0
  31. data/examples/rails3_root/config/environments/production.rb +42 -0
  32. data/examples/rails3_root/config/environments/test.rb +30 -0
  33. data/examples/rails3_root/config/initializers/backtrace_silencers.rb +7 -0
  34. data/examples/rails3_root/config/initializers/cookie_verification_secret.rb +7 -0
  35. data/examples/rails3_root/config/initializers/delayed_job.rb +1 -0
  36. data/examples/{rails_root → rails3_root}/config/initializers/inflections.rb +0 -0
  37. data/examples/{rails_root → rails3_root}/config/initializers/mime_types.rb +0 -0
  38. data/examples/rails3_root/config/initializers/notifier_job.rb +1 -0
  39. data/examples/rails3_root/config/initializers/rspec_generator.rb +6 -0
  40. data/examples/rails3_root/config/initializers/session_store.rb +10 -0
  41. data/examples/rails3_root/config/locales/en.yml +5 -0
  42. data/examples/rails3_root/config/routes.rb +7 -0
  43. data/examples/{rails_root → rails3_root}/db/migrate/20090125013728_create_users.rb +0 -0
  44. data/examples/{rails_root → rails3_root}/db/migrate/20090908054656_create_delayed_jobs.rb +0 -0
  45. data/examples/{rails_root → rails3_root}/db/schema.rb +7 -6
  46. data/examples/rails3_root/db/seeds.rb +7 -0
  47. data/examples/rails3_root/doc/README_FOR_APP +2 -0
  48. data/examples/{rails_root → rails3_root}/features/attachments.feature +0 -0
  49. data/examples/{rails_root → rails3_root}/features/delayed_job.feature +0 -0
  50. data/examples/{rails_root → rails3_root}/features/errors.feature +0 -0
  51. data/examples/{sinatra → rails3_root}/features/example.feature +9 -0
  52. data/examples/{rails_root → rails3_root}/features/step_definitions/user_steps.rb +2 -2
  53. data/examples/rails3_root/features/step_definitions/web_steps.rb +219 -0
  54. data/examples/{rails_root → rails3_root}/features/support/env.rb +10 -10
  55. data/examples/rails3_root/features/support/env_ext.rb +2 -0
  56. data/examples/{rails_root → rails3_root}/features/support/paths.rb +2 -2
  57. data/examples/rails3_root/lib/notifier_job.rb +5 -0
  58. data/examples/{rails_root → rails3_root}/lib/tasks/cucumber.rake +6 -0
  59. data/examples/rails3_root/lib/tasks/rspec.rake +69 -0
  60. data/examples/rails3_root/public/404.html +26 -0
  61. data/examples/rails3_root/public/422.html +26 -0
  62. data/examples/rails3_root/public/500.html +26 -0
  63. data/examples/{rails_root → rails3_root}/public/favicon.ico +0 -0
  64. data/examples/{rails_root → rails3_root}/public/images/rails.png +0 -0
  65. data/examples/{rails_root → rails3_root}/public/javascripts/application.js +0 -0
  66. data/examples/{rails_root → rails3_root}/public/javascripts/controls.js +5 -3
  67. data/examples/{rails_root → rails3_root}/public/javascripts/dragdrop.js +7 -6
  68. data/examples/{rails_root → rails3_root}/public/javascripts/effects.js +8 -13
  69. data/examples/{rails_root → rails3_root}/public/javascripts/prototype.js +1573 -1019
  70. data/examples/rails3_root/public/javascripts/rails.js +109 -0
  71. data/examples/{rails_root → rails3_root}/public/robots.txt +0 -0
  72. data/examples/{rails_root → rails3_root}/script/cucumber +0 -0
  73. data/examples/rails3_root/script/rails +9 -0
  74. data/examples/rails3_root/spec/controllers/welcome_controller_spec.rb +20 -0
  75. data/examples/{rails_root → rails3_root}/spec/models/user_mailer_spec.rb +7 -18
  76. data/examples/rails3_root/spec/spec_helper.rb +19 -0
  77. data/examples/sinatra_root/config.ru +4 -0
  78. data/examples/{sinatra → sinatra_root}/features/errors.feature +0 -0
  79. data/examples/{rails_root → sinatra_root}/features/example.feature +0 -0
  80. data/examples/{sinatra → sinatra_root}/features/step_definitions/user_steps.rb +2 -2
  81. data/examples/sinatra_root/features/step_definitions/web_steps.rb +219 -0
  82. data/examples/sinatra_root/features/support/env.rb +21 -0
  83. data/examples/{sinatra → sinatra_root}/features/support/paths.rb +9 -4
  84. data/examples/sinatra_root/lib/example_sinatra_app.rb +35 -0
  85. data/lib/email_spec.rb +2 -2
  86. data/lib/email_spec/deliveries.rb +7 -11
  87. data/lib/email_spec/email_viewer.rb +1 -1
  88. data/lib/email_spec/helpers.rb +7 -7
  89. data/lib/email_spec/mail_ext.rb +11 -0
  90. data/lib/email_spec/matchers.rb +31 -26
  91. data/lib/generators/email_spec/steps/USAGE +5 -0
  92. data/lib/generators/email_spec/steps/steps_generator.rb +14 -0
  93. data/{examples/rails3_root/features/step_definitions → lib/generators/email_spec/steps/templates}/email_steps.rb +0 -0
  94. data/spec/email_spec/helpers_spec.rb +4 -6
  95. data/spec/email_spec/mail_ext_spec.rb +34 -0
  96. data/spec/email_spec/matchers_spec.rb +227 -37
  97. data/spec/spec_helper.rb +14 -2
  98. metadata +174 -207
  99. data/examples/rails_root/Rakefile +0 -13
  100. data/examples/rails_root/app/controllers/application_controller.rb +0 -15
  101. data/examples/rails_root/app/controllers/welcome_controller.rb +0 -16
  102. data/examples/rails_root/app/helpers/application_helper.rb +0 -3
  103. data/examples/rails_root/app/helpers/welcome_helper.rb +0 -2
  104. data/examples/rails_root/app/models/user_mailer.rb +0 -39
  105. data/examples/rails_root/config/boot.rb +0 -110
  106. data/examples/rails_root/config/cucumber.yml +0 -7
  107. data/examples/rails_root/config/environment.rb +0 -28
  108. data/examples/rails_root/config/environments/cucumber.rb +0 -29
  109. data/examples/rails_root/config/environments/development.rb +0 -17
  110. data/examples/rails_root/config/environments/production.rb +0 -28
  111. data/examples/rails_root/config/environments/test.rb +0 -28
  112. data/examples/rails_root/config/initializers/new_rails_defaults.rb +0 -17
  113. data/examples/rails_root/config/routes.rb +0 -45
  114. data/examples/rails_root/doc/README_FOR_APP +0 -5
  115. data/examples/rails_root/features/step_definitions/web_steps.rb +0 -273
  116. data/examples/rails_root/features/support/env_ext.rb +0 -6
  117. data/examples/rails_root/public/404.html +0 -30
  118. data/examples/rails_root/public/422.html +0 -30
  119. data/examples/rails_root/public/500.html +0 -33
  120. data/examples/rails_root/public/dispatch.rb +0 -10
  121. data/examples/rails_root/script/about +0 -4
  122. data/examples/rails_root/script/autospec +0 -5
  123. data/examples/rails_root/script/console +0 -3
  124. data/examples/rails_root/script/dbconsole +0 -3
  125. data/examples/rails_root/script/delayed_job +0 -5
  126. data/examples/rails_root/script/destroy +0 -3
  127. data/examples/rails_root/script/generate +0 -3
  128. data/examples/rails_root/script/performance/benchmarker +0 -3
  129. data/examples/rails_root/script/performance/profiler +0 -3
  130. data/examples/rails_root/script/performance/request +0 -3
  131. data/examples/rails_root/script/plugin +0 -3
  132. data/examples/rails_root/script/process/inspector +0 -3
  133. data/examples/rails_root/script/process/reaper +0 -3
  134. data/examples/rails_root/script/process/spawner +0 -3
  135. data/examples/rails_root/script/runner +0 -3
  136. data/examples/rails_root/script/server +0 -3
  137. data/examples/rails_root/script/spec +0 -5
  138. data/examples/rails_root/script/spec_server +0 -125
  139. data/examples/rails_root/spec/controllers/welcome_controller_spec.rb +0 -15
  140. data/examples/rails_root/spec/model_factory.rb +0 -6
  141. data/examples/rails_root/spec/models/user_spec.rb +0 -5
  142. data/examples/rails_root/spec/rcov.opts +0 -2
  143. data/examples/rails_root/spec/spec.opts +0 -4
  144. data/examples/rails_root/spec/spec_helper.rb +0 -51
  145. data/examples/sinatra/app.rb +0 -33
  146. data/examples/sinatra/features/step_definitions/email_steps.rb +0 -182
  147. data/examples/sinatra/features/step_definitions/web_steps.rb +0 -273
  148. data/examples/sinatra/features/support/env.rb +0 -39
  149. data/examples/sinatra_root/features/step_definitions/email_steps.rb +0 -194
  150. data/lib/email_spec/#helpers.rb# +0 -168
  151. data/spec/spec.opts +0 -4
@@ -1,13 +0,0 @@
1
- require(File.join(File.dirname(__FILE__), 'config', 'boot'))
2
-
3
- require 'rake'
4
- require 'rake/testtask'
5
- require 'rake/rdoctask'
6
-
7
- require 'tasks/rails'
8
-
9
- begin
10
- require 'delayed/tasks'
11
- rescue LoadError
12
- STDERR.puts "Run `rake gems:install` to install delayed_job"
13
- end
@@ -1,15 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- helper :all # include all helpers, all the time
6
-
7
- # See ActionController::RequestForgeryProtection for details
8
- # Uncomment the :secret if you're not using the cookie session store
9
- protect_from_forgery # :secret => 'a74714b35b202f269f7a297709d555ce'
10
-
11
- # See ActionController::Base for details
12
- # Uncomment this to filter the contents of submitted sensitive data parameters
13
- # from your application log (in this case, all fields with names like "password").
14
- # filter_parameter_logging :password
15
- end
@@ -1,16 +0,0 @@
1
- class WelcomeController < ApplicationController
2
- def signup
3
- UserMailer.deliver_signup(params['Email'], params['Name'])
4
- end
5
-
6
- def confirm
7
- end
8
-
9
- def newsletter
10
- UserMailer.send_later(:deliver_newsletter, params['Email'], params['Name'])
11
- end
12
-
13
- def attachments
14
- UserMailer.deliver_attachments(params['Email'], params['Name'])
15
- end
16
- end
@@ -1,3 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module ApplicationHelper
3
- end
@@ -1,2 +0,0 @@
1
- module WelcomeHelper
2
- end
@@ -1,39 +0,0 @@
1
- class UserMailer < ActionMailer::Base
2
- default_url_options = {:host => 'example.com'}
3
- def signup(email, name)
4
- @recipients = email
5
- @from = "admin@example.com"
6
- @subject = "Account confirmation"
7
- @sent_on = Time.now
8
- @body[:name] = name
9
- end
10
-
11
- def newsletter(email, name)
12
- @recipients = email
13
- @from = "admin@example.com"
14
- @subject = "Newsletter sent"
15
- @sent_on = Time.now
16
- @body[:name] = name
17
- end
18
-
19
- def attachments(email, name)
20
- @recipients = email
21
- @from = "admin@example.com"
22
- @subject = "Attachments test"
23
- @sent_on = Time.now
24
- @body[:name] = name
25
- add_attachment 'image.png'
26
- add_attachment 'document.pdf'
27
- end
28
-
29
- private
30
-
31
- def add_attachment(attachment_name)
32
- content_type 'multipart/mixed'
33
- attachment_path = File.join(RAILS_ROOT, 'attachments', attachment_name)
34
- File.open(attachment_path) do |file|
35
- filename = File.basename(file.path)
36
- attachment :filename => filename, :content_type => File.mime_type?(file), :body => file.read
37
- end
38
- end
39
- end
@@ -1,110 +0,0 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
3
-
4
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
-
6
- module Rails
7
- class << self
8
- def boot!
9
- unless booted?
10
- preinitialize
11
- pick_boot.run
12
- end
13
- end
14
-
15
- def booted?
16
- defined? Rails::Initializer
17
- end
18
-
19
- def pick_boot
20
- (vendor_rails? ? VendorBoot : GemBoot).new
21
- end
22
-
23
- def vendor_rails?
24
- File.exist?("#{RAILS_ROOT}/vendor/rails")
25
- end
26
-
27
- def preinitialize
28
- load(preinitializer_path) if File.exist?(preinitializer_path)
29
- end
30
-
31
- def preinitializer_path
32
- "#{RAILS_ROOT}/config/preinitializer.rb"
33
- end
34
- end
35
-
36
- class Boot
37
- def run
38
- load_initializer
39
- Rails::Initializer.run(:set_load_path)
40
- end
41
- end
42
-
43
- class VendorBoot < Boot
44
- def load_initializer
45
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46
- Rails::Initializer.run(:install_gem_spec_stubs)
47
- Rails::GemDependency.add_frozen_gem_path
48
- end
49
- end
50
-
51
- class GemBoot < Boot
52
- def load_initializer
53
- self.class.load_rubygems
54
- load_rails_gem
55
- require 'initializer'
56
- end
57
-
58
- def load_rails_gem
59
- if version = self.class.gem_version
60
- gem 'rails', version
61
- else
62
- gem 'rails'
63
- end
64
- rescue Gem::LoadError => load_error
65
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
66
- exit 1
67
- end
68
-
69
- class << self
70
- def rubygems_version
71
- Gem::RubyGemsVersion rescue nil
72
- end
73
-
74
- def gem_version
75
- if defined? RAILS_GEM_VERSION
76
- RAILS_GEM_VERSION
77
- elsif ENV.include?('RAILS_GEM_VERSION')
78
- ENV['RAILS_GEM_VERSION']
79
- else
80
- parse_gem_version(read_environment_rb)
81
- end
82
- end
83
-
84
- def load_rubygems
85
- min_version = '1.3.2'
86
- require 'rubygems'
87
- unless rubygems_version >= min_version
88
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
89
- exit 1
90
- end
91
-
92
- rescue LoadError
93
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
94
- exit 1
95
- end
96
-
97
- def parse_gem_version(text)
98
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
99
- end
100
-
101
- private
102
- def read_environment_rb
103
- File.read("#{RAILS_ROOT}/config/environment.rb")
104
- end
105
- end
106
- end
107
- end
108
-
109
- # All that for this:
110
- Rails.boot!
@@ -1,7 +0,0 @@
1
- <%
2
- rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
- rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
- std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
5
- %>
6
- default: <%= std_opts %>
7
- wip: --tags @wip:3 --wip features
@@ -1,28 +0,0 @@
1
- # Be sure to restart your server when you modify this file
2
-
3
- # Uncomment below to force Rails into production mode when
4
- # you don't control web/app server and can't set it the proper way
5
- # ENV['RAILS_ENV'] ||= 'production'
6
-
7
- # Specifies gem version of Rails to use when vendor/rails is not present
8
- RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
9
-
10
- # Bootstrap the Rails environment, frameworks, and default configuration
11
- require File.join(File.dirname(__FILE__), 'boot')
12
-
13
- Rails::Initializer.run do |config|
14
-
15
- config.action_mailer.default_url_options = { :host => "example.com" }
16
-
17
- config.gem 'fixjour', :lib => 'fixjour'
18
- config.gem 'delayed_job', :lib => 'delayed_job'
19
- config.gem 'mimetype-fu', :lib => 'mimetype_fu'
20
-
21
- config.time_zone = 'UTC'
22
-
23
- config.action_controller.session = {
24
- :session_key => '_es_session',
25
- :secret => 'b9327c7967925fb36f8901e43f47e0a3e8fc7856ae1b4533ddeda776381548f9ac051721446fdbc4ccc88c7353124708e73d8b0950a30487571d8f8eb5b24732'
26
- }
27
-
28
- end
@@ -1,29 +0,0 @@
1
- # Edit at your own peril - it's recommended to regenerate this file
2
- # in the future when you upgrade to a newer version of Cucumber.
3
-
4
- # IMPORTANT: Setting config.cache_classes to false is known to
5
- # break Cucumber's use_transactional_fixtures method.
6
- # For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165
7
- config.cache_classes = true
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.action_controller.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Disable request forgery protection in test environment
17
- config.action_controller.allow_forgery_protection = false
18
-
19
- # Tell Action Mailer not to deliver emails to the real world.
20
- # The :test delivery method accumulates sent emails in the
21
- # ActionMailer::Base.deliveries array.
22
- config.action_mailer.delivery_method = :test
23
-
24
- config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
25
- config.gem 'database_cleaner', :lib => false, :version => '>=0.5.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
26
- config.gem 'webrat', :lib => false, :version => '>=0.7.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
27
- config.gem 'rspec', :lib => false, :version => '>=1.3.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
28
- config.gem 'rspec-rails', :lib => false, :version => '>=1.3.2' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
29
-
@@ -1,17 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # In the development environment your application's code is reloaded on
4
- # every request. This slows down response time but is perfect for development
5
- # since you don't have to restart the webserver when you make code changes.
6
- config.cache_classes = false
7
-
8
- # Log error messages when you accidentally call methods on nil.
9
- config.whiny_nils = true
10
-
11
- # Show full error reports and disable caching
12
- config.action_controller.consider_all_requests_local = true
13
- config.action_view.debug_rjs = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
@@ -1,28 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The production environment is meant for finished, "live" apps.
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Full error reports are disabled and caching is turned on
8
- config.action_controller.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
- config.action_view.cache_template_loading = true
11
-
12
- # See everything in the log (default is :info)
13
- # config.log_level = :debug
14
-
15
- # Use a different logger for distributed setups
16
- # config.logger = SyslogLogger.new
17
-
18
- # Use a different cache store in production
19
- # config.cache_store = :mem_cache_store
20
-
21
- # Enable serving of images, stylesheets, and javascripts from an asset server
22
- # config.action_controller.asset_host = "http://assets.example.com"
23
-
24
- # Disable delivery errors, bad email addresses will be ignored
25
- # config.action_mailer.raise_delivery_errors = false
26
-
27
- # Enable threaded mode
28
- # config.threadsafe!
@@ -1,28 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The test environment is used exclusively to run your application's
4
- # test suite. You never need to work with it otherwise. Remember that
5
- # your test database is "scratch space" for the test suite and is wiped
6
- # and recreated between test runs. Don't rely on the data there!
7
- config.cache_classes = true
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.action_controller.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
- config.action_view.cache_template_loading = true
16
-
17
- # Disable request forgery protection in test environment
18
- config.action_controller.allow_forgery_protection = false
19
-
20
- # Tell Action Mailer not to deliver emails to the real world.
21
- # The :test delivery method accumulates sent emails in the
22
- # ActionMailer::Base.deliveries array.
23
- config.action_mailer.delivery_method = :test
24
-
25
- # Use SQL instead of Active Record's schema dumper when creating the test database.
26
- # This is necessary if your schema can't be completely dumped by the schema dumper,
27
- # like if you have constraints or database-specific column types
28
- # config.active_record.schema_format = :sql
@@ -1,17 +0,0 @@
1
- # These settings change the behavior of Rails 2 apps and will be defaults
2
- # for Rails 3. You can remove this initializer when Rails 3 is released.
3
-
4
- if defined?(ActiveRecord)
5
- # Include Active Record class name as root for JSON serialized output.
6
- ActiveRecord::Base.include_root_in_json = true
7
-
8
- # Store the full class name (including module namespace) in STI type column.
9
- ActiveRecord::Base.store_full_sti_class = true
10
- end
11
-
12
- # Use ISO 8601 format for JSON serialized times and dates.
13
- ActiveSupport.use_standard_json_time_format = true
14
-
15
- # Don't escape HTML entities in JSON, leave that for the #json_escape helper.
16
- # if you're including raw json in an HTML page.
17
- ActiveSupport.escape_html_entities_in_json = false
@@ -1,45 +0,0 @@
1
- ActionController::Routing::Routes.draw do |map|
2
- # The priority is based upon order of creation: first created -> highest priority.
3
-
4
- # Sample of regular route:
5
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6
- # Keep in mind you can assign values other than :controller and :action
7
-
8
- # Sample of named route:
9
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
10
- # This route can be invoked with purchase_url(:id => product.id)
11
-
12
- # Sample resource route (maps HTTP verbs to controller actions automatically):
13
- # map.resources :products
14
-
15
- # Sample resource route with options:
16
- # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
17
-
18
- # Sample resource route with sub-resources:
19
- # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
20
-
21
- # Sample resource route with more complex sub-resources
22
- # map.resources :products do |products|
23
- # products.resources :comments
24
- # products.resources :sales, :collection => { :recent => :get }
25
- # end
26
-
27
- # Sample resource route within a namespace:
28
- # map.namespace :admin do |admin|
29
- # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
30
- # admin.resources :products
31
- # end
32
-
33
- # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
34
- map.root :controller => "welcome", :action => "index"
35
- map.confirm_account "/confirm", :controller => "welcome", :action => "confirm"
36
- map.request_newsletter "/newsletter", :controller => "welcome", :action => "newsletter"
37
- map.request_attachments "/attachments", :controller => "welcome", :action => "attachments"
38
- # See how all your routes lay out with "rake routes"
39
-
40
- # Install the default routes as the lowest priority.
41
- # Note: These default routes make all actions in every controller accessible via GET requests. You should
42
- # consider removing the them or commenting them out if you're using named routes and resources.
43
- map.connect ':controller/:action/:id'
44
- map.connect ':controller/:action/:id.:format'
45
- end
@@ -1,5 +0,0 @@
1
- To build the guides:
2
-
3
- * Install source-highlighter (http://www.gnu.org/software/src-highlite/source-highlight.html)
4
- * Install the mizuho gem (http://github.com/FooBarWidget/mizuho/tree/master)
5
- * Run `rake guides` from the railties directory
@@ -1,273 +0,0 @@
1
- # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
- # It is recommended to regenerate this file in the future when you upgrade to a
3
- # newer version of cucumber-rails. Consider adding your own code to a new file
4
- # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
- # files.
6
-
7
-
8
- require 'uri'
9
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
10
-
11
- # Commonly used webrat steps
12
- # http://github.com/brynary/webrat
13
-
14
- Given /^(?:|I )am on (.+)$/ do |page_name|
15
- visit path_to(page_name)
16
- end
17
-
18
- When /^(?:|I )go to (.+)$/ do |page_name|
19
- visit path_to(page_name)
20
- end
21
-
22
- When /^(?:|I )press "([^\"]*)"$/ do |button|
23
- click_button(button)
24
- end
25
-
26
- When /^(?:|I )follow "([^\"]*)"$/ do |link|
27
- click_link(link)
28
- end
29
-
30
- When /^(?:|I )follow "([^\"]*)" within "([^\"]*)"$/ do |link, parent|
31
- click_link_within(parent, link)
32
- end
33
-
34
- When /^(?:|I )fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
35
- fill_in(field, :with => value)
36
- end
37
-
38
- When /^(?:|I )fill in "([^\"]*)" for "([^\"]*)"$/ do |value, field|
39
- fill_in(field, :with => value)
40
- end
41
-
42
- # Use this to fill in an entire form with data from a table. Example:
43
- #
44
- # When I fill in the following:
45
- # | Account Number | 5002 |
46
- # | Expiry date | 2009-11-01 |
47
- # | Note | Nice guy |
48
- # | Wants Email? | |
49
- #
50
- # TODO: Add support for checkbox, select og option
51
- # based on naming conventions.
52
- #
53
- When /^(?:|I )fill in the following:$/ do |fields|
54
- fields.rows_hash.each do |name, value|
55
- When %{I fill in "#{name}" with "#{value}"}
56
- end
57
- end
58
-
59
- When /^(?:|I )select "([^\"]*)" from "([^\"]*)"$/ do |value, field|
60
- select(value, :from => field)
61
- end
62
-
63
- # Use this step in conjunction with Rail's datetime_select helper. For example:
64
- # When I select "December 25, 2008 10:00" as the date and time
65
- When /^(?:|I )select "([^\"]*)" as the date and time$/ do |time|
66
- select_datetime(time)
67
- end
68
-
69
- # Use this step when using multiple datetime_select helpers on a page or
70
- # you want to specify which datetime to select. Given the following view:
71
- # <%= f.label :preferred %><br />
72
- # <%= f.datetime_select :preferred %>
73
- # <%= f.label :alternative %><br />
74
- # <%= f.datetime_select :alternative %>
75
- # The following steps would fill out the form:
76
- # When I select "November 23, 2004 11:20" as the "Preferred" date and time
77
- # And I select "November 25, 2004 10:30" as the "Alternative" date and time
78
- When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" date and time$/ do |datetime, datetime_label|
79
- select_datetime(datetime, :from => datetime_label)
80
- end
81
-
82
- # Use this step in conjunction with Rail's time_select helper. For example:
83
- # When I select "2:20PM" as the time
84
- # Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
85
- # will convert the 2:20PM to 14:20 and then select it.
86
- When /^(?:|I )select "([^\"]*)" as the time$/ do |time|
87
- select_time(time)
88
- end
89
-
90
- # Use this step when using multiple time_select helpers on a page or you want to
91
- # specify the name of the time on the form. For example:
92
- # When I select "7:30AM" as the "Gym" time
93
- When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" time$/ do |time, time_label|
94
- select_time(time, :from => time_label)
95
- end
96
-
97
- # Use this step in conjunction with Rail's date_select helper. For example:
98
- # When I select "February 20, 1981" as the date
99
- When /^(?:|I )select "([^\"]*)" as the date$/ do |date|
100
- select_date(date)
101
- end
102
-
103
- # Use this step when using multiple date_select helpers on one page or
104
- # you want to specify the name of the date on the form. For example:
105
- # When I select "April 26, 1982" as the "Date of Birth" date
106
- When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" date$/ do |date, date_label|
107
- select_date(date, :from => date_label)
108
- end
109
-
110
- When /^(?:|I )check "([^\"]*)"$/ do |field|
111
- check(field)
112
- end
113
-
114
- When /^(?:|I )uncheck "([^\"]*)"$/ do |field|
115
- uncheck(field)
116
- end
117
-
118
- When /^(?:|I )choose "([^\"]*)"$/ do |field|
119
- choose(field)
120
- end
121
-
122
- # Adds support for validates_attachment_content_type. Without the mime-type getting
123
- # passed to attach_file() you will get a "Photo file is not one of the allowed file types."
124
- # error message
125
- When /^(?:|I )attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field|
126
- type = path.split(".")[1]
127
-
128
- case type
129
- when "jpg"
130
- type = "image/jpg"
131
- when "jpeg"
132
- type = "image/jpeg"
133
- when "png"
134
- type = "image/png"
135
- when "gif"
136
- type = "image/gif"
137
- end
138
-
139
- attach_file(field, path, type)
140
- end
141
-
142
- Then /^(?:|I )should see "([^\"]*)"$/ do |text|
143
- if defined?(Spec::Rails::Matchers)
144
- response.should contain(text)
145
- else
146
- assert_contain text
147
- end
148
- end
149
-
150
- Then /^(?:|I )should see "([^\"]*)" within "([^\"]*)"$/ do |text, selector|
151
- within(selector) do |content|
152
- if defined?(Spec::Rails::Matchers)
153
- content.should contain(text)
154
- else
155
- hc = Webrat::Matchers::HasContent.new(text)
156
- assert hc.matches?(content), hc.failure_message
157
- end
158
- end
159
- end
160
-
161
- Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
162
- regexp = Regexp.new(regexp)
163
- if defined?(Spec::Rails::Matchers)
164
- response.should contain(regexp)
165
- else
166
- assert_match(regexp, response_body)
167
- end
168
- end
169
-
170
- Then /^(?:|I )should see \/([^\/]*)\/ within "([^\"]*)"$/ do |regexp, selector|
171
- within(selector) do |content|
172
- regexp = Regexp.new(regexp)
173
- if defined?(Spec::Rails::Matchers)
174
- content.should contain(regexp)
175
- else
176
- assert_match(regexp, content)
177
- end
178
- end
179
- end
180
-
181
- Then /^(?:|I )should not see "([^\"]*)"$/ do |text|
182
- if defined?(Spec::Rails::Matchers)
183
- response.should_not contain(text)
184
- else
185
- assert_not_contain(text)
186
- end
187
- end
188
-
189
- Then /^(?:|I )should not see "([^\"]*)" within "([^\"]*)"$/ do |text, selector|
190
- within(selector) do |content|
191
- if defined?(Spec::Rails::Matchers)
192
- content.should_not contain(text)
193
- else
194
- hc = Webrat::Matchers::HasContent.new(text)
195
- assert !hc.matches?(content), hc.negative_failure_message
196
- end
197
- end
198
- end
199
-
200
- Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
201
- regexp = Regexp.new(regexp)
202
- if defined?(Spec::Rails::Matchers)
203
- response.should_not contain(regexp)
204
- else
205
- assert_not_contain(regexp)
206
- end
207
- end
208
-
209
- Then /^(?:|I )should not see \/([^\/]*)\/ within "([^\"]*)"$/ do |regexp, selector|
210
- within(selector) do |content|
211
- regexp = Regexp.new(regexp)
212
- if defined?(Spec::Rails::Matchers)
213
- content.should_not contain(regexp)
214
- else
215
- assert_no_match(regexp, content)
216
- end
217
- end
218
- end
219
-
220
- Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
221
- if defined?(Spec::Rails::Matchers)
222
- field_labeled(field).value.should =~ /#{value}/
223
- else
224
- assert_match(/#{value}/, field_labeled(field).value)
225
- end
226
- end
227
-
228
- Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, value|
229
- if defined?(Spec::Rails::Matchers)
230
- field_labeled(field).value.should_not =~ /#{value}/
231
- else
232
- assert_no_match(/#{value}/, field_labeled(field).value)
233
- end
234
- end
235
-
236
- Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
237
- if defined?(Spec::Rails::Matchers)
238
- field_labeled(label).should be_checked
239
- else
240
- assert field_labeled(label).checked?
241
- end
242
- end
243
-
244
- Then /^the "([^\"]*)" checkbox should not be checked$/ do |label|
245
- if defined?(Spec::Rails::Matchers)
246
- field_labeled(label).should_not be_checked
247
- else
248
- assert !field_labeled(label).checked?
249
- end
250
- end
251
-
252
- Then /^(?:|I )should be on (.+)$/ do |page_name|
253
- if defined?(Spec::Rails::Matchers)
254
- URI.parse(current_url).path.should == path_to(page_name)
255
- else
256
- assert_equal path_to(page_name), URI.parse(current_url).path
257
- end
258
- end
259
-
260
- Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
261
- actual_params = CGI.parse(URI.parse(current_url).query)
262
- expected_params = Hash[expected_pairs.rows_hash.map{|k,v| [k,[v]]}]
263
-
264
- if defined?(Spec::Rails::Matchers)
265
- actual_params.should == expected_params
266
- else
267
- assert_equal expected_params, actual_params
268
- end
269
- end
270
-
271
- Then /^show me the page$/ do
272
- save_and_open_page
273
- end