{"id":173,"date":"2012-11-14T19:17:24","date_gmt":"2012-11-15T01:17:24","guid":{"rendered":"http:\/\/sha.nnoncarey.com\/blog\/?p=173"},"modified":"2016-03-04T18:02:52","modified_gmt":"2016-03-05T00:02:52","slug":"rspecs-rake-tasks-not-loaded-in-rails-engine","status":"publish","type":"post","link":"https:\/\/sha.nnoncarey.com\/blog\/archives\/173","title":{"rendered":"Rspec-rails&#8217;s rake tasks not loaded in Rails engine"},"content":{"rendered":"<p>Having trouble getting the Rspec rake tasks to appear when you run &#8220;rake -T&#8221; in your Rails engine? The dummy app (which you should have if you specified &#8211;full) is not pulling in the Bundler dependencies, and as a result the rspec-rails Railtie subclass is not being created.<\/p>\n<p>The fix, for me at least, is changing spec\/dummy\/config\/application.rb line 11 or so to:<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">Bundler.require(*Rails.groups)<\/pre>\n<p>You should now have tasks such as &#8220;rake app:spec&#8221; available.<\/p>\n<p>You may also need to update your root Rakefile to run the specs by default, by adding &#8220;task :default => &#8216;app:spec'&#8221;<\/p>\n<p>Also see <a href=\"https:\/\/github.com\/rails\/rails\/issues\/8229\" title=\"Full Rails plugin (Engine with dummy app) doesn't load Railties from gems in the spec\">my issue on the railties Github<\/a> <\/p>\n<p>This was with Rails 3.2.8.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having trouble getting the Rspec rake tasks to appear when you run &#8220;rake -T&#8221; in your Rails engine? The dummy app (which you should have if you specified &#8211;full) is not pulling in the Bundler dependencies, and as a result the rspec-rails Railtie subclass is not being created. The fix, for me at least, is &hellip; <a href=\"https:\/\/sha.nnoncarey.com\/blog\/archives\/173\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rspec-rails&#8217;s rake tasks not loaded in Rails engine&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,16],"tags":[],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-rails","category-ruby"],"_links":{"self":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":10,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":371,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions\/371"}],"wp:attachment":[{"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sha.nnoncarey.com\/blog\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}