Remove the ActionMailer usage #41

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Owner

mike-burns commented Sep 26, 2012

We don't actually use ActionMailer in the test suite, but I ran into issues:

~/thoughtbot/high_voltage% bundle exec rspec spec/controllers/pages_controller_spec.rb
/home/mike/thoughtbot/high_voltage/spec/dummy/config/application.rb:6:in `require': no such file to load -- action_mailer/railtie (LoadError)
    from /home/mike/thoughtbot/high_voltage/spec/dummy/config/application.rb:6:in `<top (required)>'
    from /home/mike/thoughtbot/high_voltage/spec/dummy/config/environment.rb:2:in `require'
    from /home/mike/thoughtbot/high_voltage/spec/dummy/config/environment.rb:2:in `<top (required)>'
    from /home/mike/thoughtbot/high_voltage/spec/spec_helper.rb:4:in `require'
    from /home/mike/thoughtbot/high_voltage/spec/spec_helper.rb:4:in `<top (required)>'
    from /home/mike/thoughtbot/high_voltage/spec/controllers/pages_controller_spec.rb:3:in `require'
    from /home/mike/thoughtbot/high_voltage/spec/controllers/pages_controller_spec.rb:3:in `<top (required)>'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `block in load_spec_files'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `map'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in `run'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
    from /home/mike/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'
Owner

jferris commented Sep 26, 2012

I don't get it. How would this ever have required that file if it wasn't in the bundle?

Owner

mike-burns commented Sep 26, 2012

Looking at the Gemfile.lock reveals that the rest of Rails is pulled in by rspec-rails.

Might be worth noting that this works:

~/thoughtbot/high_voltage% BUNDLE_GEMFILE=gemfiles/rails-3.2.6.gemfile rspec spec/controllers/pages_controller_spec.rb

Is that the answer? Should this PR be closed and instead we should always pass the BUNDLE_GEMFILE?

Owner

jferris commented Sep 26, 2012

No, it should work with the default Gemfile. Does this mean that some versions of rspec-rails require actionmailer and some don't? I think it's fine to merge this in either way, since we're not using mailers, but I still wanted to understand what was happening.

Owner

mike-burns commented Sep 26, 2012

Also worth noting that a full rake passes regardless.

rspec-rails has never brought in action_mailer, so far as I can tell. We simply have not noticed this before.

@mike-burns mike-burns closed this Sep 26, 2012

Owner

mike-burns commented Sep 26, 2012

I've merged this regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment