Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Artur Roszczyk's Profile

GitHub User: sevos

Site: http://blog.eax.pl/

Comments by Artur Roszczyk

Avatar

Please open an issue on zeus on github

Avatar

If you would like to use zeus, guard and parallel tests together check out https://github.com/sevos/zeus-parallel_tests

Avatar

@1: Because this makes it easily configurable from, for example yml file.
@3: plan.subscriptions.build is equivalent of Subscription.new(plan: plan)

Avatar

Hey Ryan!

It was great episode. Just one think I really didn't like was defining presents method in base presenter. It could be something optional to use but in most cases we have 1-1 relation which can be expressed in BasePresenter in following way:

ruby
  def self.inherited(klass)
    name = klass.name.match(/(\w+)Presenter/).captures.first.underscore
    define_method(name) { @object }
  end

what do you think?

Avatar

why? Any particular reason for that?
and by the way: you frget that presenter initalizer takes 2 arguments

Avatar

I added spec/support/presenters.rb file and I require it from spec_helper.rb:

ruby
RSpec.configure do |config|
  config.include ActionView::TestCase::Behavior, example_group: {file_path: %r{spec/presenters}}
  config.include RSpec::Rails::Matchers::RenderTemplate, example_group: {file_path: %r{spec/presenters}}
end

the later instruction allows me simple check if presenter renders a template inside test

ruby
presenter.method.should render_template('blah/_blah')