fortitude 0.0.5-java → 0.0.6-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +20 -20
- data/CHANGES.md +19 -0
- data/CONTRIBUTORS.md +2 -0
- data/fortitude.gemspec +1 -0
- data/lib/fortitude/rails/railtie.rb +27 -75
- data/lib/fortitude/rails/rendering_methods.rb +77 -0
- data/lib/fortitude/tags/tags_module.rb +1 -0
- data/lib/fortitude/tilt/fortitude_template.rb +3 -1
- data/lib/fortitude/version.rb +1 -1
- data/lib/fortitude/widget/modules_and_subclasses.rb +2 -0
- data/spec/helpers/fortitude_rails_helpers.rb +19 -0
- data/spec/helpers/global_helper.rb +4 -2
- data/spec/rails/capture_system_spec.rb +1 -1
- data/spec/rails/development_mode_system_spec.rb +100 -6
- data/spec/rails/mailer_system_spec.rb +31 -0
- data/spec/rails/rendering_system_spec.rb +3 -3
- data/spec/rails/templates/development_mode_system_spec/app/controllers/development_mode_system_spec_controller.rb +16 -0
- data/spec/rails/templates/development_mode_system_spec/app/controllers/replaced_controller.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/app/mailers/development_mode_mailer.rb +17 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_mailer/mailer_formatting_test.rb +7 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_mailer/mailer_layout_test.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_mailer/mailer_view_test.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_formatting_test.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_layout_test.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/mailer_view_test.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/development_mode_system_spec/reload_widget_with_html_extension.html.rb +8 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/layouts/mail_layout.rb +7 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/replaced/reload_widget.rb +7 -0
- data/spec/rails/templates/development_mode_system_spec/app/views/shared/some_module.rb +5 -0
- data/spec/rails/templates/development_mode_system_spec/config/environments/development.rb +39 -0
- data/spec/rails/templates/mailer_system_spec/app/controllers/mailer_system_spec_controller.rb +17 -0
- data/spec/rails/templates/mailer_system_spec/app/mailers/basic_mailer.rb +25 -0
- data/spec/rails/templates/mailer_system_spec/app/views/basic_mailer/basic_mail.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/app/views/basic_mailer/mail_with_erb_layout_and_fortitude_view.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/app/views/basic_mailer/mail_with_fortitude_layout.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/app/views/basic_mailer/mail_with_fortitude_layout_and_erb_view.html.erb +1 -0
- data/spec/rails/templates/mailer_system_spec/app/views/layouts/erb_layout.html.erb +1 -0
- data/spec/rails/templates/mailer_system_spec/app/views/layouts/fortitude_layout.rb +8 -0
- data/spec/rails/templates/mailer_system_spec/app/views/mailer_system_spec/send_mail.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/app/views/mailer_system_spec/send_mail_with_erb_layout_and_fortitude_view.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/app/views/mailer_system_spec/send_mail_with_fortitude_layout.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/app/views/mailer_system_spec/send_mail_with_fortitude_layout_and_erb_view.rb +5 -0
- data/spec/rails/templates/mailer_system_spec/config/environments/production.rb +84 -0
- data/spec/rails/templates/rendering_system_spec/app/views/layouts/application.html.erb +1 -1
- data/spec/rails/templates/rules_system_spec/app/views/layouts/fortitude_layout_with_p.rb +1 -1
- data/spec/system/tilt_system_spec.rb +15 -0
- metadata +73 -16
- data/spec/helpers/rails_helpers.rb +0 -85
- data/spec/helpers/rails_server.rb +0 -390
- data/spec/rails/templates/base/app/controllers/application_controller.rb +0 -15
- data/spec/rails/templates/base/app/controllers/working_controller.rb +0 -5
- data/spec/rails/templates/base/app/views/layouts/application.html.erb +0 -11
- data/spec/rails/templates/base/config/routes.rb +0 -4
- data/spec/rails/templates/base/config/secrets.yml +0 -22
@@ -0,0 +1,31 @@
|
|
1
|
+
describe "Rails ActionMailer support", :type => :rails do
|
2
|
+
uses_rails_with_template :mailer_system_spec
|
3
|
+
|
4
|
+
it "should allow using Fortitude as a mailer template" do
|
5
|
+
expect_match("send_mail", /mail sent/)
|
6
|
+
|
7
|
+
mail = mail_sent_to('somebody@example.com')
|
8
|
+
expect(mail[:body].strip).to eq("<p>this is the basic mail!</p>")
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should allow using a Fortitude layout with a non-Fortitude view" do
|
12
|
+
expect_match("send_mail_with_fortitude_layout_and_erb_view", /mail sent/)
|
13
|
+
|
14
|
+
mail = mail_sent_to('somebody_with_fortitude_layout_and_erb_view@example.com')
|
15
|
+
expect(mail[:body].strip).to match(%r{<div><p>this is the Fortitude layout</p><p>this is the mail with an ERb view!</p>\s*</div>}i)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should allow using a non-Fortitude layout with a Fortitude view" do
|
19
|
+
expect_match("send_mail_with_erb_layout_and_fortitude_view", /mail sent/)
|
20
|
+
|
21
|
+
mail = mail_sent_to('somebody_with_erb_layout_and_fortitude_view@example.com')
|
22
|
+
expect(mail[:body].strip).to match(%r{<div><p>this is the ERb layout</p><p>this is the mail with a Fortitude view!</p>\s*</div>}i)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should allow using a Fortitude layout with a Fortitude view" do
|
26
|
+
expect_match("send_mail_with_fortitude_layout", /mail sent/)
|
27
|
+
|
28
|
+
mail = mail_sent_to('somebody_with_fortitude_layout@example.com')
|
29
|
+
expect(mail[:body].strip).to eq("<div><p>this is the Fortitude layout</p><p>this is the mail with Fortitude layout!</p></div>")
|
30
|
+
end
|
31
|
+
end
|
@@ -12,12 +12,12 @@ describe "Rails rendering support", :type => :rails do
|
|
12
12
|
|
13
13
|
it "should let you specify a widget with 'render :widget =>', which should use a layout by default" do
|
14
14
|
data = expect_match("render_widget", /hello from a widget named Fred/)
|
15
|
-
expect(data).to match(/
|
15
|
+
expect(data).to match(/oop_rails_server_base_template/)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should let you omit the layout with 'render :widget =>', if you ask for it" do
|
19
19
|
data = expect_match("render_widget_without_layout", /hello from a widget named Fred/, :no_layout => true)
|
20
|
-
expect(data).not_to match(/
|
20
|
+
expect(data).not_to match(/oop_rails_server_base_template/)
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should set the Content-Type to text/html when using render :widget" do
|
@@ -149,7 +149,7 @@ describe "Rails rendering support", :type => :rails do
|
|
149
149
|
end
|
150
150
|
|
151
151
|
it "should let you stream from a widget that's in an ERb layout" do
|
152
|
-
skip("Fortitude streaming test is not supported under Rails 3.0.x") if
|
152
|
+
skip("Fortitude streaming test is not supported under Rails 3.0.x") if rails_server.rails_version =~ /^3\.0\./
|
153
153
|
skip("Fortitude streaming test is not supported under Ruby 1.8") if RUBY_VERSION =~ /^1\.8\./
|
154
154
|
|
155
155
|
chunks = collect_chunks("stream_widget_with_layout")
|
@@ -3,7 +3,23 @@ class DevelopmentModeSystemSpecController < ApplicationController
|
|
3
3
|
@datum = "one"
|
4
4
|
end
|
5
5
|
|
6
|
+
def reload_widget_with_html_extension
|
7
|
+
@datum = "five"
|
8
|
+
end
|
9
|
+
|
6
10
|
def sample_output
|
7
11
|
@name = "Jessica"
|
8
12
|
end
|
13
|
+
|
14
|
+
def mailer_view_test
|
15
|
+
DevelopmentModeMailer.mailer_view_test.deliver
|
16
|
+
end
|
17
|
+
|
18
|
+
def mailer_layout_test
|
19
|
+
DevelopmentModeMailer.mailer_layout_test.deliver
|
20
|
+
end
|
21
|
+
|
22
|
+
def mailer_formatting_test
|
23
|
+
DevelopmentModeMailer.mailer_formatting_test.deliver
|
24
|
+
end
|
9
25
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class DevelopmentModeMailer < ActionMailer::Base
|
2
|
+
default :from => 'nobody@example.com'
|
3
|
+
|
4
|
+
def mailer_view_test
|
5
|
+
mail(:to => 'mailer_view_test@example.com', :subject => 'Mailer View Test')
|
6
|
+
end
|
7
|
+
|
8
|
+
def mailer_layout_test
|
9
|
+
mail(:to => 'mailer_layout_test@example.com', :subject => 'Mailer Layout Test') do |format|
|
10
|
+
format.html { render :layout => 'mail_layout' }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def mailer_formatting_test
|
15
|
+
mail(:to => 'mailer_formatting_test@example.com', :subject => 'Mailer Formatting Test')
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
DevelopmentModeSystemSpec::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = 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
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
# config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
# config.assets.debug = true
|
29
|
+
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
32
|
+
# Raises helpful error messages.
|
33
|
+
# config.assets.raise_runtime_errors = true
|
34
|
+
|
35
|
+
# Raises error for missing translations
|
36
|
+
# config.action_view.raise_on_missing_translations = true
|
37
|
+
|
38
|
+
config.action_mailer.delivery_method = :file
|
39
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class MailerSystemSpecController < ApplicationController
|
2
|
+
def send_mail
|
3
|
+
BasicMailer.basic_mail.deliver
|
4
|
+
end
|
5
|
+
|
6
|
+
def send_mail_with_fortitude_layout
|
7
|
+
BasicMailer.mail_with_fortitude_layout.deliver
|
8
|
+
end
|
9
|
+
|
10
|
+
def send_mail_with_fortitude_layout_and_erb_view
|
11
|
+
BasicMailer.mail_with_fortitude_layout_and_erb_view.deliver
|
12
|
+
end
|
13
|
+
|
14
|
+
def send_mail_with_erb_layout_and_fortitude_view
|
15
|
+
BasicMailer.mail_with_erb_layout_and_fortitude_view.deliver
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class BasicMailer < ActionMailer::Base
|
2
|
+
default :from => 'nobody@example.com'
|
3
|
+
|
4
|
+
def basic_mail
|
5
|
+
mail(:to => 'somebody@example.com', :subject => 'Basic Mail')
|
6
|
+
end
|
7
|
+
|
8
|
+
def mail_with_fortitude_layout
|
9
|
+
mail(:to => 'somebody_with_fortitude_layout@example.com', :subject => 'Basic Mail') do |format|
|
10
|
+
format.html { render :layout => 'fortitude_layout' }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def mail_with_fortitude_layout_and_erb_view
|
15
|
+
mail(:to => 'somebody_with_fortitude_layout_and_erb_view@example.com', :subject => 'Basic Mail') do |format|
|
16
|
+
format.html { render :layout => 'fortitude_layout' }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def mail_with_erb_layout_and_fortitude_view
|
21
|
+
mail(:to => 'somebody_with_erb_layout_and_fortitude_view@example.com', :subject => 'Basic Mail') do |format|
|
22
|
+
format.html { render :layout => 'erb_layout' }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>this is the mail with an ERb view!</p>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div><p>this is the ERb layout</p><%= yield %></div>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
MailerSystemSpec::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
# config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
# config.assets.compile = false
|
31
|
+
|
32
|
+
# Generate digests for assets URLs.
|
33
|
+
# config.assets.digest = true
|
34
|
+
|
35
|
+
# `config.assets.precompile` has moved to config/initializers/assets.rb
|
36
|
+
|
37
|
+
# Specifies the header that your server uses for sending files.
|
38
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
39
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
40
|
+
|
41
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
42
|
+
# config.force_ssl = true
|
43
|
+
|
44
|
+
# Set to :debug to see everything in the log.
|
45
|
+
config.log_level = :info
|
46
|
+
|
47
|
+
# Prepend all log lines with the following tags.
|
48
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
49
|
+
|
50
|
+
# Use a different logger for distributed setups.
|
51
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
52
|
+
|
53
|
+
# Use a different cache store in production.
|
54
|
+
# config.cache_store = :mem_cache_store
|
55
|
+
|
56
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
57
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
58
|
+
|
59
|
+
# Precompile additional assets.
|
60
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
61
|
+
# config.assets.precompile += %w( search.js )
|
62
|
+
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
65
|
+
# config.action_mailer.raise_delivery_errors = false
|
66
|
+
|
67
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
69
|
+
config.i18n.fallbacks = true
|
70
|
+
|
71
|
+
# Send deprecation notices to registered listeners.
|
72
|
+
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Disable automatic flushing of the log to improve performance.
|
75
|
+
# config.autoflush_log = false
|
76
|
+
|
77
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
78
|
+
config.log_formatter = ::Logger::Formatter.new
|
79
|
+
|
80
|
+
# Do not dump schema after migrations.
|
81
|
+
# config.active_record.dump_schema_after_migration = false
|
82
|
+
|
83
|
+
config.action_mailer.delivery_method = :file
|
84
|
+
end
|