Skip to content

Commit

Permalink
Only include MailerExampleGroup if defined.
Browse files Browse the repository at this point in the history
- Closes #307.
  • Loading branch information
CodeMonkeySteve authored and dchelimsky committed Jan 16, 2011
1 parent 26bd612 commit e01608a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -7,6 +7,7 @@
* Bug fixes
* fixed bug in which `render_views` in a nested group set the value in its
parent group.
* only include MailerExampleGroup when it is defiend (Steve Sloan)

### 2.4.1 / 2011-01-03

Expand Down
8 changes: 5 additions & 3 deletions lib/rspec/rails/example.rb
Expand Up @@ -18,9 +18,11 @@ def c.escaped_path(*parts)
c.include RSpec::Rails::HelperExampleGroup, :type => :helper, :example_group => {
:file_path => c.escaped_path(%w[spec helpers])
}
c.include RSpec::Rails::MailerExampleGroup, :type => :mailer, :example_group => {
:file_path => c.escaped_path(%w[spec mailers])
}
if defined?(RSpec::Rails::MailerExampleGroup)
c.include RSpec::Rails::MailerExampleGroup, :type => :mailer, :example_group => {
:file_path => c.escaped_path(%w[spec mailers])
}
end
c.include RSpec::Rails::ModelExampleGroup, :type => :model, :example_group => {
:file_path => c.escaped_path(%w[spec models])
}
Expand Down

0 comments on commit e01608a

Please sign in to comment.